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
Post hooks that call macros get parsed with execute = False #2370
Comments
The problem here is that calls to
Anyway, tl;dr: Hooks are the special exception to don't nest your curlies. Changing your example to:
should fix it. |
Reposting from slack... That flow definitely makes sense.
and if I try nesting the curlies on that:
.. I get:
Though, hardcoding the arguments works:
…and that’s a good enough workaround for me! |
@beckjake my thinking here is increasingly that we shouldn't store info like this at parse-time, and we'd instead be better served by re-capturing config calls at runtime. We can definitely still capture refs in hooks at parse-time, and I imagine we'll want to capture materialization configs (as ephemeral configs have nonlocal effects on other models) too. Beyond that though, I don't think there's a good reason why we couldn't capture the args provided to |
Can we include multiple pre_hook & post_hook inside a model in dbt? |
@ramtej23 Absolutely! Both |
@jtcohen6 Thank you for the reply. What exactly my question was in a model while defining the config blocks in that we will include pre_hook/post_hook. But it is not accepting the multiple pre_hook/post_hook in a single config block. Is there any way to define the pre_hook/post_hook outside the config block. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
Describe the bug
Easier to read the steps to reproduce👇 :
Steps to reproduce
Expected behavior
This macro is expected to fail, but it should fail because of
column "flibbity" does not exist
.Actual behavior
The macro fails on the
else
condition, "floo"Why this is important
There's legit reasons why you'd want to use the
if execute
statement here — for example, if you need to run an introspective query to generate your post-hook SQL.This came up because @willwnekowicz was using the following macro that generates "comment on" statements in Postgres (also works on Redshift)
System information
Which database are you using dbt with?
n/a:dbt issue
The output of
dbt --version
:0.16.1
The text was updated successfully, but these errors were encountered: