Skip to content

Commit

Permalink
Late render pre- and post-hooks configs in properties / schema YAML f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
dbeatty10 committed Aug 25, 2024
1 parent 70d7fc3 commit fbe20e9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/dbt/parser/schema_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# keyword args are rendered to capture refs in render_test_update.
# Keyword args are finally rendered at compilation time.
# Descriptions are not rendered until 'process_docs'.
# Pre- and post-hooks in configs are late-rendered.
class SchemaYamlRenderer(BaseRenderer):
def __init__(self, context: Dict[str, Any], key: str) -> None:
super().__init__(context)
Expand Down Expand Up @@ -43,6 +44,14 @@ def _is_norender_key(self, keypath: Keypath) -> bool:
if len(keypath) == 2 and keypath[1] in ("tests", "data_tests", "description"):
return True

# pre- and post-hooks
if (
len(keypath) >= 2
and keypath[0] == "config"
and keypath[1] in ("pre_hook", "post_hook")
):
return True

# versions
if len(keypath) == 5 and keypath[4] == "description":
return True
Expand Down

0 comments on commit fbe20e9

Please sign in to comment.