Skip to content

Commit

Permalink
add shim for dbt_utils.test_expression_is_true
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebruyn committed Sep 7, 2024
1 parent 0e24891 commit 9540a27
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions macros/dbt_utils/generic_tests/expression_is_true.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% macro fabric__test_expression_is_true(model, expression, column_name) %}

{% set column_list = '*' if should_store_failures() else "1 as col" %}

select
{{ column_list }}
from {{ model }}
{% if column_name is none %}
where not({{ expression }})
{%- else %}
where not({{ column_name }} {{ expression }})
{%- endif %}

{% endmacro %}

0 comments on commit 9540a27

Please sign in to comment.