Skip to content

Commit

Permalink
fix: Updated schema validation logic to column as 'validation_status' (
Browse files Browse the repository at this point in the history
…#455)

* fix: Updated schema validation logic to column as validation_status

* fix: fixed the col 'schema' referring in  sqlserver and bigquery tests files,  while running integration tests
  • Loading branch information
Raniksingh committed Apr 25, 2022
1 parent 4093625 commit e30c337
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data_validation/schema_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def execute(self):
"target_column_name",
"source_agg_value",
"target_agg_value",
"status",
"validation_status",
"error_result.details",
],
)
Expand Down
2 changes: 1 addition & 1 deletion tests/system/data_sources/test_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def test_schema_validation():
df = validator.execute()

for validation in df.to_dict(orient="records"):
assert validation["status"] == consts.VALIDATION_STATUS_SUCCESS
assert validation["validation_status"] == consts.VALIDATION_STATUS_SUCCESS


def test_cli_store_yaml_then_run_gcs():
Expand Down
2 changes: 1 addition & 1 deletion tests/system/data_sources/test_sql_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ def test_schema_validation():
df = validator.execute()

for validation in df.to_dict(orient="records"):
assert validation["status"] == consts.VALIDATION_STATUS_SUCCESS
assert validation["validation_status"] == consts.VALIDATION_STATUS_SUCCESS
4 changes: 2 additions & 2 deletions tests/system/result_handlers/test_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_dataframe(bigquery_client, table_id):
"source_column_name, target_table_name, target_column_name, "
"validation_type, aggregation_type, validation_name, "
"source_agg_value, target_agg_value, group_by_columns, "
"difference, pct_difference, pct_threshold, status, labels "
"difference, pct_difference, pct_threshold, validation_status, labels "
f" FROM `{table_id}` ORDER BY target_agg_value ASC"
).to_dataframe()

Expand Down Expand Up @@ -136,7 +136,7 @@ def test_execute_with_nan(bigquery_client, bigquery_dataset_id):
"difference": [-1.0, -1.0, _NAN, _NAN, _NAN, _NAN],
"pct_difference": [-50.0, -25.0, _NAN, _NAN, _NAN, _NAN],
"pct_threshold": [25.0, 25.0, _NAN, _NAN, _NAN, _NAN],
"status": [
"validation_status": [
consts.VALIDATION_STATUS_FAIL,
consts.VALIDATION_STATUS_SUCCESS,
_NAN,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_schema_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_execute(module_under_test, fs):
dv_client = data_validation.DataValidation(SAMPLE_SCHEMA_CONFIG, verbose=True)
result_df = dv_client.schema_validator.execute()
failures = result_df[
result_df["status"].str.contains(consts.VALIDATION_STATUS_FAIL)
result_df["validation_status"].str.contains(consts.VALIDATION_STATUS_FAIL)
]

assert len(result_df) == len(source_data[0]) + 1
Expand Down

0 comments on commit e30c337

Please sign in to comment.