Update state:modified caveat re: testing #453
Merged
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.
Description & motivation
Based on this Slack thread
Previously, I was recommending selection criteria like:
This works if the data test itself is modified, and we need to ensure that its parent models will exist when it comes time to execute that test.
If you have a multi-pronged test (e.g.
relationships
or a data test with 2+ parents), however, and only one of the parents is modified, then this selection criteria isn't going to cut it—the missing prong is not included in1+state:modified
.By contrast, it is included within the criteria of
@state:modified
, because it's the parent of a shared child: the data test. (The fact that@
now works for tests was something of a revelation earlier today, and enabled me to close dbt-labs/dbt-core#1827.)There's greater risk of extra baggage with this approach, since
@state:modified,1+test_type:data
is a more expansive set of criteria, but I think it's a small price to pay.Pre-release docs
Is this change related to an unreleased version of dbt?
next
<Changelog>[New/Changed] in v0.x.0</Changelog>
current