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

fix: Cli tools bug fix #253

Merged
merged 5 commits into from
May 19, 2021
Merged
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
27 changes: 19 additions & 8 deletions data_validation/cli_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,24 @@ def configure_arg_parser():
)

parser.add_argument("--verbose", "-v", action="store_true", help="Verbose logging")
parser.add_argument("beta", nargs='?', help="Beta flag to enable beta features for the tool.")

subparsers = parser.add_subparsers(dest="command")

_configure_run_parser(subparsers)
_configure_run_config_parser(subparsers)
_configure_connection_parser(subparsers)
_configure_find_tables(subparsers)
_configure_raw_query(subparsers)
# beta feature only available in run command
if "beta" in sys.argv:
parser.add_argument(
"beta",
nargs="?",
help="Beta flag to enable beta features for the tool.",
default="",
)
subparsers = parser.add_subparsers(dest="command")
_configure_run_parser(subparsers)
else:
subparsers = parser.add_subparsers(dest="command")
_configure_run_parser(subparsers)
_configure_run_config_parser(subparsers)
_configure_connection_parser(subparsers)
_configure_find_tables(subparsers)
_configure_raw_query(subparsers)

return parser

Expand Down Expand Up @@ -174,6 +183,8 @@ def _configure_run_config_parser(subparsers):
def _configure_run_parser(subparsers):
""" Configure arguments to run a data validation."""

# subparsers = parser.add_subparsers(dest="command")

run_parser = subparsers.add_parser(
"run", help="Manually run a validation and optionally store to config"
)
Expand Down