Skip to content

Commit

Permalink
Issue 35: increase test coverage of validation_input.py (#66)
Browse files Browse the repository at this point in the history
* Start refactoring export_schema function

* Add empty TestExportSchema

* Rename to input_helpers to validation_input

* Further refactor export_schema function

* Formatting

* Add docstrings

* Delete duplicate schema_to_json_string and export_schema functions, move ad-hoc functions to other.py

* Add some comments to other.py

* Add test to TestReadDataQualityRulesFromJson

* Move get_data_quality_rules_dict

* Add validate_schema object to test file dq_rules.json

* Add some tests for read_data_quality_rules_from_json

* Add raise JSONDecodeError

* Remove all print statements from load_data_quality_rules_from_json_string

* Replace load_data_quality_rules_from_json_string with json.loads

* Remove references to load_data_quality_rules_from_json_string

* Add test_get_data_quality_rules_dict_raises_json_decode_error

* Re-insert data_quality_rules_dict fixture

* more merge changes

* Update pyproject.toml

---------

Co-authored-by: bas <[email protected]>
Co-authored-by: Arthur Kordes <[email protected]>
Co-authored-by: ArthurKordes <[email protected]>
  • Loading branch information
4 people authored Nov 8, 2024
1 parent 0c72ab9 commit 727dc9d
Show file tree
Hide file tree
Showing 10 changed files with 467 additions and 434 deletions.
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.1"
version = "0.11.2"
authors = [
{ name="Arthur Kordes", email="[email protected]" },
{ name="Aysegul Cayir Aydar", email="[email protected]" },
Expand Down
11 changes: 5 additions & 6 deletions src/dq_suite/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""DQ API."""

from .common import ValidationSettings
from .df_checker import run
from .input_helpers import schema_to_json_string

## Use __all__ to let developers know what is part of the public API.
#__all__ = ["schema_to_json_string", "run", "ValidationSettings"]
# # Use __all__ to let developers know what is part of the public API.
# __all__ = ["export_schema_to_json_string", "run", "ValidationSettings"]
#from .common import ValidationSettings
#from .df_checker import run
#from .other import schema_to_json_string
2 changes: 1 addition & 1 deletion src/dq_suite/df_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from pyspark.sql import DataFrame

from .common import DataQualityRulesDict, Rule, RulesDict, ValidationSettings
from .input_helpers import get_data_quality_rules_dict
from .output_transformations import (
write_non_validation_tables,
write_validation_table,
)
from .validation_input import get_data_quality_rules_dict


def filter_validation_dict_by_table_name(
Expand Down
Loading

0 comments on commit 727dc9d

Please sign in to comment.