fix: raise clear error for unaccompanied graph operators in selectors#1
Open
claygeo wants to merge 1 commit into
Open
fix: raise clear error for unaccompanied graph operators in selectors#1claygeo wants to merge 1 commit into
claygeo wants to merge 1 commit into
Conversation
Selectors like '+', '@', '2+', or '+ model_name' (with a space) now raise a DbtRuntimeError with an actionable message instead of silently resolving to an empty node set or producing confusing results. Validation is applied in both from_single_spec() (CLI path) and dict_from_single_spec() (YAML selector path) via a shared _validate_graph_operator_spec() helper. Closes dbt-labs#10388
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes dbt-labs#10388
Selectors like
+,@,2+, or+ model_name(with a space between the operator and model name) previously produced confusing or silent failures — they would either resolve to an empty node set or behave unpredictably. This PR raises aDbtRuntimeErrorwith an actionable message pointing users to the correct syntax._validate_graph_operator_spec()helper so validation applies to both the CLI path (from_single_spec) and the YAML selector path (dict_from_single_spec)+ my_modelsuggests+my_model;my_model +suggestsmy_model+Test plan
python -m pytest tests/unit/graph/test_selector_spec.py -v— 32 tests passdbt run --select "+"should now raise a clear error messagedbt run --select "+my_model"should continue to work as before