-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[CT-542] [Bug] hook execution ordering not consistent with documentation #5133
Comments
Thanks @JohnMav, someone from our side will take a look.
I'd also be curious to hear more about how you're using grants for more complex grant management, given that we're thinking about adding out-of-the-box support for |
@JohnMav Thanks for opening it and providing detailed reproduction steps!!! I was able to reproduce the issue and looking into it now. |
Just checked that this behavior has been there since 0.21, @JohnMav sorry about the confusion with the document! We are going to update the docs! |
Thank you @ChenyuLInx and thank you for determining when that issue came up! |
@ChenyuLInx I do have one additional concern and happy to open this as a different issue, but this hook execution ordering isn't very consistent with the documentation about configurations in general. https://docs.getdbt.com/reference/configs-and-properties#config-inheritance Most notably
Since hook execution is reversed from this general pattern it may be worthwhile to call out in the Config Inheritance and/or combining configs sections on the above page. Either that or making hook execution ordering consistent with other configurations throughout the project. |
@JohnMav Heard! From my perspective, that is consistent insofar as the most specific configs are applied last. For configs that are "clobbered" when merged ( For configs that are "appended" when merged ( |
Thanks @jtcohen6! That does make sense, would you be able to add that clarification in the docs as well? |
Is there an existing issue for this?
Current Behavior
post-hooks defined in the
dbt_project.yml
are executing prior to post-hooks defined within a model. This is inconsistent with documentation on pre-hook/post-hook execution ordering which states:Expected Behavior
post-hooks defined in dbt_project.yml run after hooks defined in the model itself as described in the pre-hook/post-hook documentation
Steps To Reproduce
models/jaffle_shop/shop_orders.sql
dbt run -s shop_orders
logs/dbt.log
We are noticing this behavior occurs in our snowflake warehouse as well. We have post-hook macros that perform operations in snowflake and the execution order remains consistent with the above example where post-hooks defined in the
dbt_project.yml
are executing prior to the post-hooks defined directly in the model. This is causing problems since we rely on execution ordering for specific role grant/revoke operations.Relevant log output
Environment
What database are you using dbt with?
snowflake
Additional Context
There is a similar issue regarding
on-run-start
/on-run-end
execution ordering in #4785 , this is possibly related to that issue as well?The text was updated successfully, but these errors were encountered: