Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove dependency on tables list for custom query #541

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data_validation/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def build_config_managers_from_args(args):

is_filesystem = source_client._source_type == "FileSystem"
tables_list = cli_tools.get_tables_list(
args.tables_list, default_value=[], is_filesystem=is_filesystem
args.tables_list, default_value=[{}], is_filesystem=is_filesystem
nehanene15 marked this conversation as resolved.
Show resolved Hide resolved
)

for table_obj in tables_list:
Expand Down
10 changes: 6 additions & 4 deletions data_validation/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,15 @@ def build_config_manager(
consts.CONFIG_TYPE: config_type,
consts.CONFIG_SOURCE_CONN_NAME: source_conn_name,
consts.CONFIG_TARGET_CONN_NAME: target_conn_name,
consts.CONFIG_TABLE_NAME: table_obj[consts.CONFIG_TABLE_NAME],
consts.CONFIG_SCHEMA_NAME: table_obj[consts.CONFIG_SCHEMA_NAME],
consts.CONFIG_TABLE_NAME: table_obj.get(consts.CONFIG_TABLE_NAME, None),
consts.CONFIG_SCHEMA_NAME: table_obj.get(consts.CONFIG_SCHEMA_NAME, None),
consts.CONFIG_TARGET_SCHEMA_NAME: table_obj.get(
consts.CONFIG_TARGET_SCHEMA_NAME, table_obj[consts.CONFIG_SCHEMA_NAME]
consts.CONFIG_TARGET_SCHEMA_NAME,
table_obj.get(consts.CONFIG_SCHEMA_NAME, None),
),
consts.CONFIG_TARGET_TABLE_NAME: table_obj.get(
consts.CONFIG_TARGET_TABLE_NAME, table_obj[consts.CONFIG_TABLE_NAME]
consts.CONFIG_TARGET_TABLE_NAME,
table_obj.get(consts.CONFIG_TABLE_NAME, None),
),
consts.CONFIG_LABELS: labels,
consts.CONFIG_THRESHOLD: threshold,
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ validations:
#### Run a custom query column validation
````shell script
data-validation validate --custom-query-type column custom-query --source-query-file source_query.sql --target-query-file target_query.sql -sc my_bq_conn -tc my_bq_conn -tbls bigquery-public-data.new_york_citibike.citibike_stations
data-validation validate custom-query --custom-query-type column --source-query-file source_query.sql --target-query-file target_query.sql -sc my_bq_conn -tc my_bq_conn
````
#### Run a custom query validation with sum aggregation
Expand Down