Skip to content

Commit

Permalink
Ensure Testview Name Uniqueness with MD5 of Model Name and Invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
prdpsvs committed Dec 23, 2024
1 parent 3725fcb commit f0ffd7d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dbt/include/fabric/macros/materializations/tests/helpers.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% macro get_fabric_test_sql(database, schema, main_sql, fail_calc, warn_if, error_if, limit) -%}

{{ log ("local_md5(model.name): "~ local_md5(model.name))}}
{{ log ("local_md5(invocation_id): "~ local_md5(invocation_id))}}
{% set testview %}
[{{ schema }}.testview_{{ range(1300, 19000) | random }}]

[{{ schema }}.testview_{{ local_md5(model.name ~ invocation_id) }}]
{% endset %}

{% set sql = main_sql.replace("'", "''")%}
Expand Down

0 comments on commit f0ffd7d

Please sign in to comment.