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: Refactor CLI to fit Command Pattern #303

Merged
merged 5 commits into from
Sep 16, 2021

Conversation

nehanene15
Copy link
Collaborator

Closes #279

Updates DVT to use validation type specific commands like so:

data-validation validate column --flags
data-validation validate schema --flags

Updated documentation and examples to reflect the change. It is backwards compatible to continue support for the data-validation run command.

@nehanene15 nehanene15 changed the title Refactor CLI to fit Command Pattern feat: Refactor CLI to fit Command Pattern Aug 31, 2021
Copy link
Collaborator

@renzokuken renzokuken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. I have one question regarding the switch to the -bqrh flag but aside from that Approve.

-sc my_bq_conn -tc my_bq_conn \
-tbls bigquery-public-data.new_york_citibike.citibike_trips,bigquery-public-data.new_york_citibike.citibike_stations \
--sum tripduration,start_station_name --count tripduration,start_station_name \
-rc pso-kokoro-resources.pso_data_validator.results
-bqrh pso-kokoro-resources.pso_data_validator.results
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen inconsistencies with the -bqrh flag on the develop branch. Do we have a test that this is currently functional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the --bqrh flag runs exactly the same as the -rc flag using the cli_tools.get_result_handler() function. We have a test for it in test_cli_tools.py. The code will first check to see if the --bqrh flag was supplied; if not, it will check if the --rc flag exists; If neither are provided it will set to None.

Copy link
Collaborator

@renzokuken renzokuken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nehanene15 nehanene15 merged commit f6d2b9d into develop Sep 16, 2021
@nehanene15 nehanene15 deleted the issue279-command-pattern branch September 16, 2021 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor CLI to Command Pattern
2 participants