-
Notifications
You must be signed in to change notification settings - Fork 69
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
Built-in unique test to not be explicitly added to "primary_key_test_macros" #497
base: main
Are you sure you want to change the base?
Conversation
f5493ed
to
3a14760
Compare
I feel like CircleCI is out to get me. I've pushed the same commit 3 or 4 times with amended comments to trigger a new CI execution, and the failures are not always the same, as well as unrelated to the changes of this PR (non-exsiting tables, failed freshness / non-documented model tests ...) Thanks <3 |
…est_macros" list in order to avoid name collisions on unique test definition overrides
Thanks @PatFitzner I think that the original piece of code on I think that your approach is correct but I will need to do a few more checks. |
Hi @PatFitzner Sorry for the delay here. I finally spent the time looking at this issue and your PR looks all good! Thanks for the contribution. As this is a bug we might release it before the v1 that we are planning to release soon. |
Thank you, Benoit! Looking forward to v1 |
In order to avoid name collisions on unique test definition overrides, the line that explicitly adds the builtin
dbt.test_unique
test to the "primary_key_test_macros" list has been replaced with a conditional block that will only add it if none of the tests already present in the "primary_key_test_macros" list would produce ais_test_unique
column in theint_all_graph_resources
model, which is required downstream byint_model_test_summary
.This is a:
Link to Issue
Closes 496
Description & motivation
Line 10 of
models/marts/core/int_all_graph_resources.sql
{%- do test_macro_list.append("dbt.test_unique") -%}
Is supposed to ensure that the column
is_test_unique
is generated, but breaks the execution of the package when the default testdbt.test_unique
has been overridden in a project.Checklist