Skip to content
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

sql_header does not support Jinja + macros #2977

Open
1 task done
dbeatty10 opened this issue Mar 10, 2023 · 0 comments
Open
1 task done

sql_header does not support Jinja + macros #2977

dbeatty10 opened this issue Mar 10, 2023 · 0 comments
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@dbeatty10
Copy link
Contributor

Contributions

  • 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/sql_header

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

As mentioned here, Jinja + macros (including ref + source) will not work as expected inside of sql_header. This is different than pre/post-hooks which do support Jinja + macros (by "late rendering" them).

This should be some kind of highlighted warning/note in the docs.

The note could read something like the following:

Unlike pre-/post-hooks, macros like ref and source and references like {{ this }} are not supported.

An option is to include commentary like:

The intended purpose of set_sql_header is quite narrow: creating UDFs, setting script variables (BQ), setting temporary session parameters (Snowflake), etc.

Additional information

No response

@dbeatty10 dbeatty10 added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear labels Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

No branches or pull requests

1 participant