From 5a353e17a25c301ff56d8a39f40e31caf788f293 Mon Sep 17 00:00:00 2001 From: Bas Date: Mon, 18 Nov 2024 14:34:54 +0100 Subject: [PATCH] Fix - import readme (#72) * Fix info in README.md about import * Change check_name to validation_name * Version to 0.11.4 * Changed run to run_validation --------- Co-authored-by: bas Co-authored-by: ArthurKordes --- README.md | 4 ++-- pyproject.toml | 2 +- src/dq_suite/__init__.py | 4 ++-- src/dq_suite/validation.py | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 66ed585..d673470 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,9 @@ pip install dq-suite-amsterdam 4. Finally, perform the validation by running ```python -import dq_suite +from dq_suite.validation import run_validation -dq_suite.validation.run( +run_validation( json_path=dq_rule_json_path, df=df, spark_session=spark, diff --git a/pyproject.toml b/pyproject.toml index 29802d1..3892da1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "dq-suite-amsterdam" -version = "0.11.3" +version = "0.11.4" authors = [ { name="Arthur Kordes", email="a.kordes@amsterdam.nl" }, { name="Aysegul Cayir Aydar", email="a.cayiraydar@amsterdam.nl" }, diff --git a/src/dq_suite/__init__.py b/src/dq_suite/__init__.py index 6f8b2e9..657afe2 100644 --- a/src/dq_suite/__init__.py +++ b/src/dq_suite/__init__.py @@ -2,7 +2,7 @@ # from .common import ValidationSettings # from .other import schema_to_json_string -# from .validation import run +# from .validation import run_validation # # # Use __all__ to let developers know what is part of the public API. -# __all__ = ["schema_to_json_string", "run", "ValidationSettings"] +# __all__ = ["schema_to_json_string", "run_validation", "ValidationSettings"] diff --git a/src/dq_suite/validation.py b/src/dq_suite/validation.py index d2b7cd0..808a3df 100644 --- a/src/dq_suite/validation.py +++ b/src/dq_suite/validation.py @@ -251,11 +251,11 @@ def _get_or_add_checkpoint( (self.data_context.checkpoints.add(checkpoint=checkpoint)) return checkpoint - def run( + def run_validation( self, batch_parameters: Dict[str, DataFrame] ) -> CheckpointResult: # pragma: no cover - only GX functions checkpoint = self._get_or_add_checkpoint() - return checkpoint.run(batch_parameters=batch_parameters) + return checkpoint.run_validation(batch_parameters=batch_parameters) def validate( @@ -285,16 +285,16 @@ def validate( validation_runner_obj.create_validation_definition() print("***Starting validation run***") - return validation_runner_obj.run(batch_parameters={"dataframe": df}) + return validation_runner_obj.run_validation(batch_parameters={"dataframe": df}) -def run( +def run_validation( json_path: str, df: DataFrame, spark_session: SparkSession, catalog_name: str, table_name: str, - check_name: str, + validation_name: str, data_context_root_dir: str = "/dbfs/great_expectations/", slack_webhook: str | None = None, ms_teams_webhook: str | None = None, @@ -324,7 +324,7 @@ def run( spark_session=spark_session, catalog_name=catalog_name, table_name=table_name, - validation_name=check_name, + validation_name=validation_name, data_context_root_dir=data_context_root_dir, slack_webhook=slack_webhook, ms_teams_webhook=ms_teams_webhook,