Skip to content

Commit

Permalink
1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Sep 5, 2023
1 parent badc918 commit 16429e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/regression_suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,3 @@ jobs:
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false

mypy:
name: Type Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set Up Environment
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Requirements
run: |
python -m pip install --upgrade pip mypy
pip install -r $GITHUB_WORKSPACE/tests/requirements.txt
- name: Execute Test
run: mypy data_expectations
11 changes: 8 additions & 3 deletions data_expectations/internals/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import typing

from data_expectations import ColumnExpectation
from data_expectations import Expectations
from data_expectations.errors import ExpectationNotMetError
from data_expectations.errors import ExpectationNotUnderstoodError
Expand Down Expand Up @@ -39,9 +40,13 @@ def evaluate_record(expectations: Expectations, record: dict, suppress_errors: b
if expectation not in ALL_EXPECTATIONS:
raise ExpectationNotUnderstoodError(expectation=expectation)

if not ALL_EXPECTATIONS[expectation](
row=record, column=expectation_definition.column, **expectation_definition.config
):
base_config = {"row": record, **expectation_definition.config}

# Conditionally include the 'column' parameter
if isinstance(expectation_definition, ColumnExpectation):
base_config["column"] = expectation_definition.column

if not ALL_EXPECTATIONS[expectation](**base_config):
if not suppress_errors:
raise ExpectationNotMetError(expectation, record)
return False # data failed to meet expectation
Expand Down
4 changes: 2 additions & 2 deletions data_expectations/internals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def to_dict(self) -> Dict[str, Any]:
@classmethod
def load(cls: Type["Expectation"], serialized: Union[Dict[str, Any], str]) -> "Expectation":
if isinstance(serialized, str):
serialized = json.loads(serialized)
serialized = dict(json.loads(serialized))

serialized_copy: dict = deepcopy(serialized)

Expand All @@ -43,7 +43,7 @@ def to_dict(self) -> Dict[str, Any]:
@classmethod
def load(cls: Type["ColumnExpectation"], serialized: Union[Dict[str, Any], str]) -> "ColumnExpectation":
if isinstance(serialized, str):
serialized = json.loads(serialized)
serialized = dict(json.loads(serialized))

serialized_copy: dict = deepcopy(serialized)

Expand Down

0 comments on commit 16429e9

Please sign in to comment.