-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema test macro referencing package macro errors in parse-time rendering #3324
Comments
jtcohen6
changed the title
Bug:
Schema test macro referencing package macro errors in parse-time rendering
May 6, 2021
5 tasks
Possibly related: we're still seeing error #3229 for tests defined in packages. (Thanks @MartinNowak for the report, I just confirmed locally.) Defined in a package: {% macro test_valid_code(model) %}
select count(*) from (
select * from {{ model }}
left join {{ ref('model_b') }}
)
{% endmacro %} Defined in the root project: version: 2
models:
- name: model_a
tests:
- core_pkg.valid_code Error:
|
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: