-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a path:
selector to the node selector (#454)
#2258
Conversation
This was previously marked as blocked, but I figured I'd just try to get this in before anyone starts working on #2167 in a breaking way. |
wicked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One request here, but otherwise this is looking really good!
core/dbt/graph/selector.py
Outdated
search = chain(self.parsed_nodes(included_nodes), | ||
self.source_nodes(included_nodes)) | ||
for node, real_node in search: | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about doing a prefix match instead of an exact filepath match? That would let us do something like
dbt run -m models/path/to/models
In this scenario, dbt would select all of the nodes located at or below that specified filepath. You buy it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I don't have strong feelings about that. I guess it would give us parity with the fqn selector, which seems good.
07fcd09
to
9823cc6
Compare
Instead of always being FQN by default, path-like selectors default to PATH Paths referring to non-root packages are ignored Added a test to the dependency tests that checks both of these
Also, added more tests
9823cc6
to
f8ee056
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM!
We should also update the autocomplete script to support path-based selectors. Just made an issue to track that change here: dbt-labs/dbt-completion.bash#5
resolves #454
Description
\
or/
on windows,/
on macos/linux)Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.