-
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 pseudo selectors that select models based on artifact states #2465
Comments
This would indeed be great to have. On the implementation side, I think this really requires tracking model run state in a database. |
Coming back to this just to say: I think we should pick a different name for the selection method that leverages
Up for debate:
|
Another idea that we've thrown around in some Slack discussions: Using the
I think this would require using multiple |
See also #2172, #2425
Describe the feature
This change would be in support of:
If dbt is provided artifacts (manifest, run_results) produced from a previous run of dbt, then dbt will be able to determine:
Here are some high-level example usage scenarios:
Implementation details
dbt is going to need to point to the artifacts from a previous invocation to compare manifests or determine build statuses from a previous run. To accomplish this, we could add a flag like
--state
which should point to a folder containing the manifest and run_results from a previous invocation of dbt. It will be the users responsibility to make sure these artifacts are present in their environment.--state flag:
compile
,run
,test
,seed
,snapshot
, andls
). It can definitely be a flag to subcommands (or both) if that makes sensetarget/
dbt run --models build:error
will fail with an appropriate error if thetarget/
dir does not existSelectors:
state:modified
: Will select any nodes whose hashes have changed compared to the value present in the manifest artifactstate:new
: Will select any nodes which are present in the project but are not present in the manifest artifactbuild:error
: Will select any nodes which errored or were skipped in run_results state artifactbuild:success
: I don't know that there's a concrete use-case for something like this, but it seems sensible to implement selectors for different statesDetermining nodes that have changed
This is a tricky problem! A very simple version of this functionality can be implemented with a
git diff --name-only
. That will get you pretty far, but it will not account for:generate_schema_name
) or thedbt_project.yml
fileDescribe alternatives you've considered
Who will this benefit?
The text was updated successfully, but these errors were encountered: