Skip to content

Commit

Permalink
tests: Add dvt_binary column validation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nj1973 committed Nov 26, 2024
1 parent 482a0a3 commit 8f60a1a
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 3 deletions.
7 changes: 4 additions & 3 deletions data_validation/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,10 +1059,11 @@ def _get_target_raw_data_types(self) -> dict:
return self._target_raw_data_types

def _is_oracle_lob(self, casefold_column_name: str) -> bool:
"""Checks if a column in either the source or target database is an Oracle LOB (Large Object) data type.
"""Checks if a column in either the source or target database is an Oracle LOB data type.
Args:
casefold_column_name: The case-insensitive name of the column to check."""
casefold_column_name: The case-insensitive name of the column to check.
"""
return bool(
self._get_source_raw_data_types()
.get(casefold_column_name, "")
Expand Down
16 changes: 16 additions & 0 deletions tests/system/data_sources/test_db2.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ def test_column_validation_core_types_to_bigquery():
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
)
def test_column_validation_dvt_binary_to_bigquery():
"""DB2 to BigQuery dvt_binary column validation"""
column_validation_test(
tc="bq-conn",
tables="db2inst1.dvt_binary=pso_data_validator.dvt_binary",
count_cols="*",
sum_cols="*",
min_cols="*",
max_cols="*",
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
Expand Down
16 changes: 16 additions & 0 deletions tests/system/data_sources/test_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,22 @@ def test_column_validation_core_types_to_bigquery():
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
)
def test_column_validation_dvt_binary_to_bigquery():
"""MySQL to BigQuery dvt_binary column validation"""
column_validation_test(
tc="bq-conn",
tables="pso_data_validator.dvt_binary",
count_cols="*",
sum_cols="*",
min_cols="*",
max_cols="*",
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
Expand Down
16 changes: 16 additions & 0 deletions tests/system/data_sources/test_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,22 @@ def test_column_validation_oracle_to_postgres():
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
)
def test_column_validation_dvt_binary_to_bigquery():
"""Oracle to BigQuery dvt_binary column validation"""
column_validation_test(
tc="bq-conn",
tables="pso_data_validator.dvt_binary",
count_cols="*",
sum_cols="*",
min_cols="*",
max_cols="*",
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
Expand Down
16 changes: 16 additions & 0 deletions tests/system/data_sources/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,22 @@ def test_column_validation_core_types_to_bigquery():
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
)
def test_column_validation_dvt_binary_to_bigquery():
"""PostgreSQL to BigQuery dvt_binary column validation"""
column_validation_test(
tc="bq-conn",
tables="pso_data_validator.dvt_binary",
count_cols="*",
sum_cols="*",
min_cols="*",
max_cols="*",
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
Expand Down
16 changes: 16 additions & 0 deletions tests/system/data_sources/test_sql_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,22 @@ def test_column_validation_core_types_to_bigquery():
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
)
def test_column_validation_dvt_binary_to_bigquery():
"""SQL Server to BigQuery dvt_binary column validation"""
column_validation_test(
tc="bq-conn",
tables="pso_data_validator.dvt_binary",
count_cols="*",
sum_cols="*",
min_cols="*",
max_cols="*",
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
Expand Down
16 changes: 16 additions & 0 deletions tests/system/data_sources/test_teradata.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,22 @@ def test_column_validation_time_table_to_bigquery():
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
)
def test_column_validation_dvt_binary_to_bigquery():
"""Teradata to BigQuery dvt_binary column validation"""
column_validation_test(
tc="bq-conn",
tables="udf.dvt_binary=pso_data_validator.dvt_binary",
count_cols="*",
sum_cols="*",
min_cols="*",
max_cols="*",
)


@mock.patch(
"data_validation.state_manager.StateManager.get_connection_config",
new=mock_get_connection_config,
Expand Down

0 comments on commit 8f60a1a

Please sign in to comment.