Skip to content

Commit

Permalink
Merge pull request #8 from Snowflake-Labs/6-dbt_constraints-produces-…
Browse files Browse the repository at this point in the history
…an-error-if-there-are-singular-tests-in-dbt

Fix to check test_metadata exists for test
  • Loading branch information
sfc-gh-dflippo authored Jun 6, 2022
2 parents 5edf2e9 + d77d904 commit e695926
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions integration_tests/tests/singlular_test.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT *
FROM {{ ref('dim_part') }}
WHERE 1 = 2
1 change: 1 addition & 0 deletions macros/create_constraints.sql
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
{%- for res in results
if res.status == "pass"
and res.node.config.materialized == "test"
and res.node.test_metadata
and res.node.test_metadata.name is in( constraint_types )
and res.node.config.where is none -%}

Expand Down

0 comments on commit e695926

Please sign in to comment.