in data_validation/cli_tools.py [0:0]
def _configure_custom_query_column_parser(custom_query_column_parser):
# Group optional arguments
optional_arguments = custom_query_column_parser.add_argument_group(
"optional arguments"
)
optional_arguments.add_argument(
"--count",
"-count",
help="Comma separated list of columns for count 'col_a,col_b' or * for all columns",
)
optional_arguments.add_argument(
"--sum",
"-sum",
help="Comma separated list of columns for sum 'col_a,col_b' or * for all columns",
)
optional_arguments.add_argument(
"--avg",
"-avg",
help="Comma separated list of columns for avg 'col_a,col_b' or * for all columns",
)
optional_arguments.add_argument(
"--min",
"-min",
help="Comma separated list of columns for min 'col_a,col_b' or * for all columns",
)
optional_arguments.add_argument(
"--max",
"-max",
help="Comma separated list of columns for max 'col_a,col_b' or * for all columns",
)
optional_arguments.add_argument(
"--bit_xor",
"-bit_xor",
help="Comma separated list of columns for hashing a concatenate 'col_a,col_b' or * for all columns",
)
optional_arguments.add_argument(
"--std",
"-std",
help="Comma separated list of columns for standard deviation 'col_a,col_b' or * for all columns",
)
optional_arguments.add_argument(
"--exclude-columns",
"-ec",
action="store_true",
help="Flag to indicate the list of columns should be excluded from validation and not included.",
)
optional_arguments.add_argument(
"--wildcard-include-string-len",
"-wis",
action="store_true",
help="Include string fields for wildcard aggregations.",
)
optional_arguments.add_argument(
"--wildcard-include-timestamp",
"-wit",
action="store_true",
help="Include timestamp/date fields for wildcard aggregations.",
)
optional_arguments.add_argument(
"--cast-to-bigint",
"-ctb",
action="store_true",
help="Cast any int32 fields to int64 for large aggregations.",
)
optional_arguments.add_argument(
"--filters",
"-filters",
type=get_filters,
default=[],
help="Filters in the format source_filter:target_filter",
)
optional_arguments.add_argument(
"--threshold",
"-th",
type=threshold_float,
default=0.0,
help="Float max threshold for percent difference",
)
# Group required arguments
required_arguments = custom_query_column_parser.add_argument_group(
"required arguments"
)
# Group for mutually exclusive source query arguments. Either must be supplied
source_mutually_exclusive = required_arguments.add_mutually_exclusive_group(
required=True
)
source_mutually_exclusive.add_argument(
"--source-query-file",
"-sqf",
help="File containing the source sql query",
)
source_mutually_exclusive.add_argument(
"--source-query",
"-sq",
help="Source sql query",
)
# Group for mutually exclusive target query arguments. Either must be supplied
target_mutually_exclusive = required_arguments.add_mutually_exclusive_group(
required=True
)
target_mutually_exclusive.add_argument(
"--target-query-file",
"-tqf",
help="File containing the target sql query",
)
target_mutually_exclusive.add_argument(
"--target-query",
"-tq",
help="Target sql query",
)
_add_common_arguments(optional_arguments, required_arguments)