Skip to content

Commit

Permalink
Correctly skipping constraints when there was a failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dflippo committed Sep 30, 2024
1 parent e03845a commit 3fb434e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

name: 'dbt_constraints'
version: '1.0.3'
version: '1.0.4'
config-version: 2

# These macros depend on the results and graph objects in dbt >=0.19.0
Expand Down
6 changes: 3 additions & 3 deletions macros/create_constraints.sql
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@
{%- for res in results
if res.node.config.materialized == "test"
and res.node.unique_id == test_model.unique_id -%}
{%- if not res.failures -%}
{#- Set NORELY if we do not know if there is a test failure -#}
{{ return('NORELY') }}
{%- if res.failures == None -%}
{#- Set '' if we do not know if there is a test failure -#}
{{ return('') }}
{%- elif res.failures > 0 -%}
{#- Set NORELY if there is a test failure -#}
{{ return('NORELY') }}
Expand Down

0 comments on commit 3fb434e

Please sign in to comment.