-
Notifications
You must be signed in to change notification settings - Fork 179
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
Feature/support query tags in tests #210
Merged
+29
−0
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b38cb0c
initial test materialization with query tagging
matt-winkler 29cce46
set adapter to snowflake
matt-winkler ccc77d3
move over core materialization code for testing
matt-winkler 76593af
add query tagging macros
matt-winkler c7f9d1c
revise with jtcohen's version
matt-winkler baceaea
add validation on query tags for tests
matt-winkler 783bc70
merge from main
matt-winkler faa780c
add changelog entry
matt-winkler 7df015e
update changelog again
matt-winkler 1f0773e
fix linting issue & update changelog with PR
matt-winkler 5efc47d
update changelog using changie
matt-winkler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Features | ||
body: Support query tags in dbt tests using the `+query_tag` config in `dbt_project.yml` | ||
time: 2022-08-15T23:35:05.967484-06:00 | ||
custom: | ||
Author: matt-winkler | ||
Issue: "211" | ||
PR: "210" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{%- materialization test, adapter='snowflake' -%} | ||
|
||
{% set original_query_tag = set_query_tag() %} | ||
{% set relations = materialization_test_default() %} | ||
{% do unset_query_tag(original_query_tag) %} | ||
{{ return(relations) }} | ||
|
||
{%- endmaterialization -%} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: view_model_query_tag | ||
columns: | ||
- name: id | ||
tests: | ||
- unique |
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
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.
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.
I'd hope that all of this could just be:
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.
Right on! had that initially, then went to the full copy from dbt-core. Will shift back, test etc. Thanks @jtcohen6
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.
Hey @jtcohen6 with this set up, I can configure query tags to run on tests from the
dbt_project.yml
:BUT, I can't set them from a
schema.yml
:Should I be able to make this setting in both places?
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.
@matt-winkler Good catch. Unfortunately, this will have to come as a separate unit of work: dbt-labs/dbt-core#5532