Skip to content

Commit

Permalink
Merge pull request #497 from PatFitzner/main
Browse files Browse the repository at this point in the history
Built-in unique test to not be explicitly added to "primary_key_test_macros"
  • Loading branch information
b-per authored Dec 5, 2024
2 parents e29b7e1 + 7f8f935 commit 9a70f9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions models/marts/core/int_all_graph_resources.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

{# flatten the sets of permissable primary key test sets to one level for later iteration #}
{%- set test_macro_list = [] %}
{%- set test_macro_names_list = [] %}
{%- for test_set in var('primary_key_test_macros') -%}
{%- for test in test_set %}
{%- do test_macro_list.append(test) -%}
{%- do test_macro_list.append(test) -%}
{%- endfor %}
{%- endfor -%}
{%- do test_macro_list.append("dbt.test_unique") -%}
{% for test in test_macro_list %}
{%- do test_macro_names_list.append(test.split('.')[1]) -%}
{%- endfor -%}
{%- if "test_unique" not in test_macro_names_list -%}
{%- do test_macro_list.append("dbt.test_unique") -%}
{%- endif -%}
{%- set test_macro_set = set_strict(test_macro_list) -%}

{%- set quoted_directory_pattern = wrap_string_with_quotes(get_directory_pattern()) %}
Expand Down

0 comments on commit 9a70f9a

Please sign in to comment.