Skip to content

Commit 3eab8d3

Browse files
Add in a random element as well as the hash of the SQL of the test
Add in a random element because sometimes two tests can be completely identical as the unique work of the test is done in the jinja template itself before compilation. See https://github.com/calogica/dbt-expectations/blob/main/macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql
1 parent 2c6ef66 commit 3eab8d3

File tree

1 file changed

+1
-1
lines changed
  • dbt/include/sqlserver/macros/materializations

1 file changed

+1
-1
lines changed

dbt/include/sqlserver/macros/materializations/tests.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
END
99

1010
{% set testview %}
11-
[{{ target.schema }}.testview_{{ local_md5(main_sql) }}]
11+
[{{ target.schema }}.testview_{{ local_md5(main_sql) }}_{{ range(1300, 19000) | random }}]
1212
{% endset %}
1313

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

0 commit comments

Comments
 (0)