-
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
feat(dbt): model dbt tests as asset checks only on their attached dbt node #16727
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Sep 22, 2023
Closed
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
rexledesma
force-pushed
the
rl/model-dbt-tests-on-attached-node
branch
from
September 22, 2023 19:43
7159b00
to
4d0242b
Compare
rexledesma
force-pushed
the
rl/allow-subsetted-asset-checks
branch
from
September 25, 2023 13:20
db87ca0
to
13dfb5f
Compare
rexledesma
force-pushed
the
rl/model-dbt-tests-on-attached-node
branch
from
September 25, 2023 13:20
4d0242b
to
c666554
Compare
rexledesma
force-pushed
the
rl/allow-subsetted-asset-checks
branch
from
September 25, 2023 13:28
13dfb5f
to
ea29644
Compare
rexledesma
force-pushed
the
rl/model-dbt-tests-on-attached-node
branch
2 times, most recently
from
September 25, 2023 14:30
554fd4c
to
3b1082b
Compare
PedramNavid
approved these changes
Sep 25, 2023
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.
Nicely done
johannkm
force-pushed
the
rl/allow-subsetted-asset-checks
branch
2 times, most recently
from
September 26, 2023 16:43
0d3830a
to
d64839e
Compare
rexledesma
force-pushed
the
rl/model-dbt-tests-on-attached-node
branch
from
September 26, 2023 18:03
3b1082b
to
83b5e63
Compare
johannkm
force-pushed
the
rl/allow-subsetted-asset-checks
branch
8 times, most recently
from
September 26, 2023 20:16
dc2c0f5
to
6770d5d
Compare
rexledesma
force-pushed
the
rl/allow-subsetted-asset-checks
branch
from
September 26, 2023 22:08
6770d5d
to
d405c22
Compare
rexledesma
force-pushed
the
rl/model-dbt-tests-on-attached-node
branch
from
September 26, 2023 22:08
83b5e63
to
228070a
Compare
johannkm
force-pushed
the
rl/allow-subsetted-asset-checks
branch
from
September 27, 2023 01:42
d405c22
to
dda4b01
Compare
rexledesma
force-pushed
the
rl/model-dbt-tests-on-attached-node
branch
from
September 27, 2023 01:54
228070a
to
7674850
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary & Motivation
There are certain dbt tests that act on multiple models. For example:
Currently, for these tests, we emit an
AssetCheckResult
for each of the models that the test acts on.However, this runs into an error in subsetting. When you run an individual asset that has this relationship test defined, an exception occurs because two
AssetCheckResult
's when you run this test. This does not match the expected targeted assets.A sample error:
Some solutions:
In this change, we implement (2). Furthermore, we prevent singular tests from being modeled as dbt tests, as they are not currently defined on a node.
In the future, we can also model singular tests that only target a single dbt node reference.
How I Tested These Changes
pytest: update existing tests, add singular test and assert that it is not modeled as an asset check.