-
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
[Bug] Unable to use macros in schema.yml pre/post-hook #9482
Comments
Thanks for doing that research and raising this issue @jtmcn ! #6411 looks like something different to me. But #7128 looks like exactly the same thing, so I'm going close this issue in favor of re-opening it. In the meantime, here's something that should work for you -- add your pre hook to your model's
Let me know if that doesn't work for some reason! |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this a new bug in dbt-core?
Current Behavior
When a macro is added to a pre-hook or post in a model config block in yaml, it results in a Compilation Error.
Expected Behavior
The macro should not be rendered when the yaml is parsed, causing an error. It should be rendered at run time.
Steps To Reproduce
some_macro.sql
dbt compile
Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
Previously existing, but closed bug 7128
In a potentially related bug 6425 @jtcohen6 refers to
renderer.py
where theshould_render_keypath
function was looking forpost-hook
rather thanpost_hook
. I see that both are now accepted in thelate_rendered_hooks
. However, in my debugging it looks like the keypath is empty and thus returns True before reaching thatif
statementThe text was updated successfully, but these errors were encountered: