I’m basically trying to create a Data Quality macro that uses some great expectations macros, ala:
{% test primary_key_test(model, columns) %}
{%- for column in columns %}
{{ dbt_expectations.expect_column_values_to_not_be_null(model, column) }}
{{ dbt_expectations.expect_column_values_to_be_unique(model, column) }}
{% endfor %}
{% endtest %}
It errors when testing with with “expect_column_values_to_not_be_null is undefined”. It generates a .sql file for the test in target>run>models>schema.yml but it is just the wrapper, not the actual .sql test.
Calling dbt_expectations.expect_column_values_to_not_be_null in the schema.yml as a test works fine.
Had the same issue trying to utilize macros from dbt_utils in my tests.