Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General examples of calling a macro in a hook (#5972)
[Preview: Calling a macro in a hook](https://docs-getdbt-com-git-dbeatty10-patch-2-dbt-labs.vercel.app/docs/build/hooks-operations#calling-a-macro-in-a-hook) [Preview: pre-hook & post-hook ](https://docs-getdbt-com-git-dbeatty10-patch-2-dbt-labs.vercel.app/reference/resource-configs/pre-hook-post-hook) ## What are you changing in this pull request and why? We have a couple concrete examples of calling a macro in a hook (like [here](https://docs.getdbt.com/reference/project-configs/on-run-start-on-run-end#call-a-macro-to-grant-privileges) and [here](https://docs.getdbt.com/reference/resource-configs/pre-hook-post-hook#apache-spark-analyze-tables-after-creation)). But we don't currently have any co-located canonical examples of the different locations where hooks can be configured: 1. SQL model config 1. `properties.yml` \* 1. `dbt_project.yml` \* Calling a macro in a hook within a properties YAML file was fixed in v1.8+ by dbt-labs/dbt-core#10603. ## Other pages to review Once dbt-labs/dbt-core#7128 is resolved, we should also review these pages to ensure they include examples of configs across `dbt_project` YAML files, properties YAML files, and node-level config in SQL files: - https://docs.getdbt.com/reference/resource-configs/pre-hook-post-hook - https://docs.getdbt.com/reference/model-configs#apply-configurations-to-one-model-only - https://docs.getdbt.com/reference/seed-configs#apply-the-schema-configuration-to-one-seed-only ## Additional context Inspired by dbt-labs/dbt-core#10522 ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. --------- Co-authored-by: Mirna Wong <[email protected]>
- Loading branch information