dbt-labs / dbt-labs/docs.getdbt.com

Expand guidance on late-rendering for hooks

Open
#2,818 1 comment 0 reactions 1 assignee Claimed by @matthewshaver View on GitHub
content dbt Core improvement paper cut priority: medium size: medium
Dominant language
JavaScript
Stars
215
Forks
1.2k
Avg merge
1d 15h
Merged PRs (30d)
130

Description

### Contributions

- [X] I have read the contribution docs, and understand what's expected of me.

### Link to the page on docs.getdbt.com requiring updates

https://docs.getdbt.com/reference/resource-configs/pre-hook-post-hook
https://docs.getdbt.com/docs/building-a-dbt-project/dont-nest-your-curlies#an-exception

### What part(s) of the page would you like to see updated?

This is one of my least favorite things in dbt. It should not be considered a "happy path." And yet we get issues about it all the time:
- https://github.com/dbt-labs/dbt-core/issues/4023#issuecomment-941643201
- https://github.com/dbt-labs/dbt-core/issues/6249#issuecomment-1318534859
- https://github.com/dbt-labs/dbt-core/issues/6411#issuecomment-1345009827
- https://github.com/dbt-labs/dbt-core/issues/6837#issuecomment-1413924647
- https://github.com/dbt-labs/dbt-core/issues/7237#issuecomment-1491764776
- https://github.com/dbt-labs/dbt-core/issues/10148#issuecomment-2113068082
- ... (among others) ...

Specifically, if you want to:
- include a `{{ ref() }}` or `{{ source() }}` call within a hook
- access `{{ this.type }}` inside a hook
- call a macro within a hook
- conditionally set and use a variable inside a hook

It would be great, during `dbt-core` issue triage, to have a clear set of documentation (with examples) to pass along. Even though this is not a pattern we recommend, exactly, it does unlock some intermediate/advanced use cases for a handful of users.

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.