Skip to content
Discussion options

You must be logged in to vote

You can do it in one dbt build. The reason it works with build specifically: run and test throw away everything that isn't their own resource type as the final step, but build keeps all of them. So you can union two selectors, "all models" and "tests in the modified graph":

dbt build \
  --select "resource_type:model" "resource_type:test,@state:modified" \
  --state path/to/artifacts

(add resource_type:seed resource_type:snapshot to the first group if you use them.)

Why your --exclude "state:unmodified,resource_type:test" nuked every test: comma is intersection, so that reads as "nodes that are unmodified AND a test." A data test on a modified model didn't change itself, so it's state:un…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jeffkeller-einc
Comment options

Answer selected by jeffkeller-einc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants