From aae2ba0b1be92fb9064de401364b1576486ab985 Mon Sep 17 00:00:00 2001 From: Mila Page <67295367+VersusFacit@users.noreply.github.com> Date: Sun, 7 Nov 2021 08:41:56 -0800 Subject: [PATCH] Parser no longer takes greedy. Accepts indirect selection, a bool. (#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 Co-authored-by: Jeremy Cohen automatic commit by git-black, original commits: e6df4266f627c589201f49501cd22e0af46e095e --- core/dbt/main.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/dbt/main.py b/core/dbt/main.py index abf911ca5c3..2745dd758c0 100644 --- a/core/dbt/main.py +++ b/core/dbt/main.py @@ -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] + [ @@ -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") @@ -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)