[Feature] Support references to ephemeral models in hooks #10033
Labels
enhancement
New feature or request
ephemeral
Issues related to dbt's ephemeral materialization
hooks
Issues related to dbt's hooks functionality
Is this your first time submitting a feature request?
Describe the feature
I have a macro that is called in a post-hook.
In that macro I have used a reference to a staging table
stg_XX
that hasephemeral
materialisation.When running my model that calls this post-hook, I get the following error:
Describe alternatives you've considered
When I switch the staging table to
view
materialisation, I no longer get the same error.However, going with this option forces me to turn my staging models from
ephemeral
toviews
, which has its own downsides and upsides. Having the possibility to use staging models in hooks should not make me decide.Who will this benefit?
Anyone who wants to reference ephemeral models in hooks.
Are you interested in contributing this feature?
No response
Anything else?
Low priority, just want to point out the unexpected behaviour.
Found a few other references about this topic:
https://stackoverflow.com/questions/64622026/how-to-refer-ephemeral-model-in-pre-post-hook-of-an-incremental-model?newreg=637b64465aca4988a305856104481766
https://discourse.getdbt.com/t/how-to-refer-ephemeral-model-in-pre-post-hook-of-an-incremental-model/1763
Might be related: https://discourse.getdbt.com/t/how-to-use-sources-inside-a-post-hook/10638
The text was updated successfully, but these errors were encountered: