You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #3272 + #3280. The schema test macro is now in the rendering context for schema tests, which is great! Now, however, if a schema test macro depends on a macro from a package, it raises an error.
In develop and v0.19.2-rc1, I'm seeing the following error:
Compilation Error in test my_test_my_model_ (models/schema.yml)
'dbt_utils' is undefined
> in macro test_my_test (macros/my_test.sql)
> called by test my_test_my_model_ (models/schema.yml)
This stacktrace should feel very familiar:
File "/usr/local/Cellar/dbt@0.19.2-rc1/0.19.2rc1_1/libexec/lib/python3.8/site-packages/dbt/parser/schemas.py", line 555, in parse_node
node = self._parse_generic_test(
File "/usr/local/Cellar/dbt@0.19.2-rc1/0.19.2rc1_1/libexec/lib/python3.8/site-packages/dbt/parser/schemas.py", line 467, in _parse_generic_test
self.render_test_update(node, config, builder)
File "/usr/local/Cellar/dbt@0.19.2-rc1/0.19.2rc1_1/libexec/lib/python3.8/site-packages/dbt/parser/schemas.py", line 505, in render_test_update
get_rendered(
We'll need to catch this UndefinedError, extend the parse-time schema test rendering context, or something else I haven't thought of.
The text was updated successfully, but these errors were encountered:
Compilation Error in test core_pkg_valid_code_model_a_ (models/schema.yml)
dbt was unable to infer all dependencies for the model "core_pkg_valid_code_model_a_".
This typically happens when ref() is placed within a conditional block.
To fix this, add the following hint to the top of the model "core_pkg_valid_code_model_a_":
-- depends_on: {{ ref('model_b') }}
> in macro test_valid_code (macros/tests.sql)
> called by test core_pkg_valid_code_model_a_ (models/schema.yml)
> called by test core_pkg_valid_code_model_a_ (models/schema.yml)
Describe the bug
Related to #3272 + #3280. The schema test macro is now in the rendering context for schema tests, which is great! Now, however, if a schema test macro depends on a macro from a package, it raises an error.
Reproduce
packages.yml
:macros/test/my_test.sql
:models/my_model.sql
:In
develop
andv0.19.2-rc1
, I'm seeing the following error:This stacktrace should feel very familiar:
We'll need to catch this UndefinedError, extend the parse-time schema test rendering context, or something else I haven't thought of.
The text was updated successfully, but these errors were encountered: