Skip to content

Commit

Permalink
fix: Cli tools bug fix (#253)
Browse files Browse the repository at this point in the history
* added an optional beta flag to be able to provide beta arguments in the future

* fix: cli_tools fix for breaking changes

* fix: lint

* fix: further fixes to resolve integration test issues
  • Loading branch information
dhaval-d committed May 19, 2021
1 parent e8e75de commit b41e625
Showing 1 changed file with 19 additions and 8 deletions.
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

0 comments on commit b41e625

Please sign in to comment.