[Bug] Unit test raising error '<macro name>' is undefined. This can happen when calling a macro that does not exist.
#10157
Labels
bug
Something isn't working
Medium Severity
bug with minor impact that does not have resolution timeframe requirement
unit tests
Issues related to built-in dbt unit testing functionality
Is this a new bug in dbt-core?
Current Behavior
Sometimes (but not always!), I get this compilation error when a model contains a macro:
Expected Behavior
This seems like it should work without needing to add an override for any macros.
Steps To Reproduce
macros/my_macros.sql
models/_unit_tests.yml
models/model_f.sql
Build and see that everything works just fine:
Update
models/model_f.sql
to add{% set ab_values = a_values + b_values %}
anywhere within the model defintion:Now re-build and see the error:
Relevant log output
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
Found while researching #10139.
The text was updated successfully, but these errors were encountered: