Skip to content

Commit af4bac3

Browse files
test: Adding more tests to DQM to display behavior (#3295)
* adding additional unit test to show profilers Signed-off-by: Francisco Javier Arceo <franciscojavierarceo@users.noreply.github.com> * linted Signed-off-by: Francisco Javier Arceo <franciscojavierarceo@users.noreply.github.com> * updated test case Signed-off-by: Francisco Javier Arceo <franciscojavierarceo@users.noreply.github.com> Signed-off-by: Francisco Javier Arceo <franciscojavierarceo@users.noreply.github.com>
1 parent 104a918 commit af4bac3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sdk/python/tests/integration/e2e/test_validation.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ def test_historical_retrieval_fails_on_validation(environment, universal_data_so
104104
features=_features,
105105
)
106106

107+
ds = store.get_saved_dataset("my_other_dataset")
108+
profiler_expectation_suite = ds.get_profile(
109+
profiler=profiler_with_unrealistic_expectations
110+
)
111+
112+
assert len(profiler_expectation_suite.expectation_suite["expectations"]) == 3
113+
107114
with pytest.raises(ValidationFailed) as exc_info:
108115
job.to_df(
109116
validation_reference=store.get_saved_dataset(
@@ -360,6 +367,7 @@ def profiler_with_feature_metadata(dataset: PandasDataset) -> ExpectationSuite:
360367

361368
@ge_profiler
362369
def profiler_with_unrealistic_expectations(dataset: PandasDataset) -> ExpectationSuite:
370+
# note: there are 4 expectations here and only 3 are returned from the profiler
363371
# need to create dataframe with corrupted data first
364372
df = pd.DataFrame()
365373
df["current_balance"] = [-100]
@@ -371,5 +379,7 @@ def profiler_with_unrealistic_expectations(dataset: PandasDataset) -> Expectatio
371379

372380
# this should pass
373381
other_ds.expect_column_min_to_be_between("avg_passenger_count", 0, 1000)
382+
# this should fail
383+
other_ds.expect_column_to_exist("missing random column")
374384

375385
return other_ds.get_expectation_suite()

0 commit comments

Comments
 (0)