Skip to content

Commit

Permalink
feat: Allow user to specify a format for stdout, added for other test…
Browse files Browse the repository at this point in the history
… cases (#242)
  • Loading branch information
Yogesh Tewari committed Jul 30, 2021
1 parent cc384f1 commit 76fbea5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/system/data_sources/test_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
def test_mysql_count_invalid_host():
try:
data_validator = data_validation.DataValidation(
CONFIG_COUNT_VALID, verbose=False,
CONFIG_COUNT_VALID, format="json", verbose=False,
)
df = data_validator.execute()
assert df["source_agg_value"][0] == df["target_agg_value"][0]
Expand Down
2 changes: 1 addition & 1 deletion tests/system/data_sources/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ def test_postgres_count():
],
}

data_validator = data_validation.DataValidation(config_count_valid, verbose=False,)
data_validator = data_validation.DataValidation(config_count_valid, format="json", verbose=False,)
df = data_validator.execute()
assert df["source_agg_value"][0] == df["target_agg_value"][0]
4 changes: 2 additions & 2 deletions tests/system/data_sources/test_spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def grouped_config(spanner_connection_config, database_id):


def test_count_validator(count_config):
validator = data_validation.DataValidation(count_config, verbose=True)
validator = data_validation.DataValidation(count_config, format="json", verbose=True)
df = validator.execute()

count_value = df[df["validation_name"] == "count"]["source_agg_value"].values[0]
Expand All @@ -186,7 +186,7 @@ def test_count_validator(count_config):


def test_grouped_count_validator(grouped_config):
validator = data_validation.DataValidation(grouped_config, verbose=True)
validator = data_validation.DataValidation(grouped_config, format="json", verbose=True)
df = validator.execute()
rows = list(df[df["validation_name"] == "count"].iterrows())

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 @@ -76,6 +76,6 @@ def test_sql_server_count():
],
}

data_validator = data_validation.DataValidation(config_count_valid, verbose=False,)
data_validator = data_validation.DataValidation(config_count_valid, format="json", verbose=False,)
df = data_validator.execute()
assert df["source_agg_value"][0] == df["target_agg_value"][0]
2 changes: 1 addition & 1 deletion tests/system/data_sources/test_teradata.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

def create_validator(builder):
return data_validation.DataValidation(
TERADATA_CONFIG, builder=builder, result_handler=None, verbose=False
TERADATA_CONFIG, builder=builder, result_handler=None, format="json", verbose=False
)


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 @@ -185,7 +185,7 @@ def test_execute(module_under_test, fs):
)
_create_table_file(TARGET_TABLE_FILE_PATH, _get_fake_json_data(target_data))

dv_client = data_validation.DataValidation(SAMPLE_SCHEMA_CONFIG, verbose=True)
dv_client = data_validation.DataValidation(SAMPLE_SCHEMA_CONFIG, format="json", verbose=True)
result_df = dv_client.schema_validator.execute()
failures = result_df[result_df["status"].str.contains("Fail")]

Expand Down

0 comments on commit 76fbea5

Please sign in to comment.