Skip to content

Commit

Permalink
Fix - import readme (#72)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: ArthurKordes <ArthurKordes>
  • Loading branch information
SSchotten and bas authored Nov 18, 2024
1 parent d5e12e3 commit 5a353e1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]" },
{ name="Aysegul Cayir Aydar", email="[email protected]" },
Expand Down
4 changes: 2 additions & 2 deletions src/dq_suite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
12 changes: 6 additions & 6 deletions src/dq_suite/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5a353e1

Please sign in to comment.