-
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
[CT-466] [Feature] Make run-operation
accept selectors to be able to use the selected_resources
Jinja variable
#5005
Comments
run-operation
accept selectors to be able to use the selected_resources
Jinja variablerun-operation
accept selectors to be able to use the selected_resources
Jinja variable
Love the issue @b-per! I'll leave some comments below, but I also don't want to stop someone from the Execution team from chiming in with more. From my perspective, there are two things that "real" dbt tasks have access to today, which
(There's one other distinction between What you're getting at feels both like a natural extension of That's honestly not far off from how other tasks work today:
So there's a lot of existing art here to leverage. The question is, how to factor this code, and present these concepts, in a way that makes sense. (Is this... custom tasks? #2381) |
@jtcohen6 Pretty much covered this already, but here's a few more thoughts:
We probably want to make the
This is def going to be a thing and I'd say that it's a requirement to add this as a proper feature to dbt. That said, it seems like a sound idea and probably quite useful if we can sort out now to keep it parallelized. |
I'll admit that my original idea didn't take the parallelism in consideration. The use case I was thinking of at first was an existing Should those operations with no/low actual queries then be differentiated from operations that rely on many calls to the Warehouse and would need parallelism to be performant? I could help with the "1. Real selection logic" but "2. Parallelism" looks like requiring much more work and design decisions. I think that 1 without 2 could already cover some use cases but if we want to solve both at the same time and avoid rework I might just leave this to someone else. |
I have been looking at it a bit more and I think that there is another design decision that needs to be taken: Currently, we have:
If we want to leverage The question then becomes if we also want to add the selected |
This would be helpful for the Slim CI in dbt cloud workflow which includes a If the cloning |
Coming back to this, I think it makes sense to treat separately the two paths I was describing above:
Support for node selection in Support for threads/parallelism. We shouldn't try exposing this to the Jinja context. Instead, we should (a) add built-in support for common use cases where multi-threading is essential, and (b) work toward a future where users can define their own custom tasks/commands (in Python). |
Would it be reasonable to enable an additional configuration on |
@matt-winkler if we enabled this additional configuration for the
|
For Snowflake:
|
@matt-winkler Is there anything that you prefer about a That proposal shakes out to:
|
Even better @jtcohen6. 0 issues with that and will avoid stacking on top of existing materialization logic in a confusing way. I'll pause on this approach. LMK if anything I can help with to accelerate the other. I think then the CI process looks like
yeah? |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Is there an existing feature request for this?
Describe the Feature
This is a spin-off from #3471. The PR #5001 is adding
selected_resources
to the Jinja context but this is currently not available to therun-operation
command that doesn't allow usage of selectors.The approach I was thinking to follow would be to:
run-operation
to accept selectors argumentsjob_queue
,_flattened_nodes
andprevious_state
from the GraphRunnableTask to the ManifestTaskdbt-core/core/dbt/task/runnable.py
Lines 106 to 115 in 0ec829a
The impact of this though would be that
run-operation
would then build the graph, which it is not doing today, which will imply a longer runtime for the command.A question is also what type of parameters do we want to allow
run-operation
to use?My original thinking is all the
build
ones but I'd be keen for some feedback. The build ones are:Describe alternatives you've considered
Not making
run-operation
be able to leverage theselected_resources
variableWho will this benefit?
People who want to write macros and operations that leverage dbt selectors.
Are you interested in contributing this feature?
Yes, I have some draft code already
Anything else?
No response
The text was updated successfully, but these errors were encountered: