Skip to content

Commit

Permalink
Build task arg parity (#3884)
Browse files Browse the repository at this point in the history
automatic commit by git-black, original commits:
  d3826e6
  • Loading branch information
Kyle Wigley authored and iknox-fa committed Feb 8, 2022
1 parent 3711ab8 commit 6303d17
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
42 changes: 22 additions & 20 deletions core/dbt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ def _build_build_subparser(subparsers, base_subparser):
""",
)
sub.add_argument(
'--store-failures',
action='store_true',
help='''
"--store-failures",
action="store_true",
help="""
Store test results (failing rows) in the database
'''
""",
)
sub.add_argument(
'--indirect-selection',
Expand All @@ -385,23 +385,25 @@ def _build_build_subparser(subparsers, base_subparser):
''',
)
resource_values: List[str] = [
str(s) for s in build_task.BuildTask.ALL_RESOURCE_VALUES
] + ['all']
sub.add_argument('--resource-type',
choices=resource_values,
action='append',
default=[],
dest='resource_types')
resource_values: List[str] = [str(s) for s in build_task.BuildTask.ALL_RESOURCE_VALUES] + [
"all"
]
sub.add_argument(
"--resource-type",
choices=resource_values,
action="append",
default=[],
dest="resource_types",
)
# explicity don't support --models
sub.add_argument(
'-s',
'--select',
dest='select',
nargs='+',
help='''
"-s",
"--select",
dest="select",
nargs="+",
help="""
Specify the nodes to include.
''',
""",
)
_add_common_selector_arguments(sub)
return sub
Expand Down Expand Up @@ -788,9 +790,9 @@ def _build_list_subparser(subparsers, base_subparser):
""",
aliases=['ls'],
)
sub.set_defaults(cls=list_task.ListTask, which='list', rpc_method=None)
sub.set_defaults(cls=list_task.ListTask, which="list", rpc_method=None)
resource_values: List[str] = [str(s) for s in list_task.ListTask.ALL_RESOURCE_VALUES] + [
str(s) for s in list_task.ListTask.ALL_RESOURCE_VALUES
"default",
"all",
sub.add_argument('--resource-type',
choices=resource_values,
Expand Down
6 changes: 3 additions & 3 deletions core/dbt/task/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BuildTask(RunTask):
RUNNER_MAP will be processed by the mapped runner class.
I.E. a resource of type Model is handled by the ModelRunner which is
imported as run_model_runner. """
imported as run_model_runner."""

MARK_DEPENDENT_ERRORS_STATUSES = [NodeStatus.Error, NodeStatus.Fail]

Expand All @@ -36,8 +36,8 @@ def resource_types(self):

values = set(self.args.resource_types)

if 'all' in values:
values.remove('all')
if "all" in values:
values.remove("all")
values.update(self.ALL_RESOURCE_VALUES)

return list(values)
Expand Down

0 comments on commit 6303d17

Please sign in to comment.