Skip to content

Commit

Permalink
Parser no longer takes greedy. Accepts indirect selection, a bool. (#…
Browse files Browse the repository at this point in the history
…4104)

* Parser no longer takes greedy. Accepts indirect selection, a bool.

* Remove references to greedy and supporting functions.

* 1. Set testing flag default to True. 2. Improve arg parsing.

* Update tests and add new case for when flag unset.

* Update names and styling to fit test requirements. Add default value for option.

* Correct several failing tests now that default behavior was flipped.

* Tests expect eager on by default.

* All but selector test passing.

* Get integration tests working, add them, and mix in selector syntax.

* Clean code and correct test.

* Add changelog entry

Co-authored-by: Mila Page <[email protected]>
Co-authored-by: Jeremy Cohen <[email protected]>

automatic commit by git-black, original commits:
  e6df426
  • Loading branch information
VersusFacit authored and iknox-fa committed Feb 8, 2022
1 parent 6303d17 commit aae2ba0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions core/dbt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,14 @@ def _build_build_subparser(subparsers, base_subparser):
""",
)
sub.add_argument(
'--indirect-selection',
choices=['eager', 'cautious'],
"--indirect-selection",
choices=["eager", "cautious"],
default="eager",
dest='indirect_selection',
dest="indirect_selection",
help="""
Select all tests that are adjacent to selected resources,
even if they those resources have been explicitly selected.
''',
""",
)

resource_values: List[str] = [str(s) for s in build_task.BuildTask.ALL_RESOURCE_VALUES] + [
Expand Down Expand Up @@ -723,14 +723,14 @@ def _build_test_subparser(subparsers, base_subparser):
""",
)
sub.add_argument(
'--indirect-selection',
choices=['eager', 'cautious'],
"--indirect-selection",
choices=["eager", "cautious"],
default="eager",
dest='indirect_selection',
dest="indirect_selection",
help="""
Select all tests that are adjacent to selected resources,
even if they those resources have been explicitly selected.
''',
""",
)

sub.set_defaults(cls=test_task.TestTask, which="test", rpc_method="test")
Expand Down Expand Up @@ -828,14 +828,14 @@ def _build_list_subparser(subparsers, base_subparser):
required=False,
)
sub.add_argument(
'--indirect-selection',
choices=['eager', 'cautious'],
"--indirect-selection",
choices=["eager", "cautious"],
default="eager",
dest='indirect_selection',
dest="indirect_selection",
help="""
Select all tests that are adjacent to selected resources,
even if they those resources have been explicitly selected.
''',
""",
)
_add_common_selector_arguments(sub)
Expand Down

0 comments on commit aae2ba0

Please sign in to comment.