[codex] Improve Jinja macro guardrails - #405
Draft
dataders wants to merge 4 commits into
Draft
Conversation
dataders
commented
Apr 27, 2026
Collaborator
Author
There was a problem hiding this comment.
what does this file do?!
Comment on lines
+12
to
+13
| {%- set column_tests = column.tests if 'tests' in column else [] -%} | ||
| {%- set nullity = 'NOT NULL' if 'not_null' in column_tests else 'NULL'-%} |
Collaborator
Author
There was a problem hiding this comment.
i think i like this but say more
Comment on lines
-4
to
-8
| {% set snowpipe = source_node.external.get('snowpipe', none) %} | ||
|
|
||
| {% set auto_refresh = external.get('auto_refresh', false) %} | ||
| {% set partitions = external.get('partitions', none) %} | ||
| {% set delta_format = (external.table_format | lower == "delta") %} |
Collaborator
Author
There was a problem hiding this comment.
these do exist in the snowpipe tables which also get refreshed with refresh_external_table btw
Comment on lines
+32
to
+37
| def test_snowflake_refresh_has_no_unused_branch_variables(self): | ||
| macro = read_macro("macros/plugins/snowflake/refresh_external_table.sql") | ||
|
|
||
| self.assertNotIn("set snowpipe", macro) | ||
| self.assertNotIn("set partitions", macro) | ||
| self.assertNotIn("set delta_format", macro) |
Collaborator
Author
There was a problem hiding this comment.
is there even a pytest harness in this repo??
dataders
commented
Apr 27, 2026
dataders
left a comment
Collaborator
Author
There was a problem hiding this comment.
Found one small cleanup before merge:
macros/plugins/redshift/helpers/add_partitions.sql:27has trailing whitespace, sogit diff --check origin/main..HEADfails. Remove the space after the opening log string line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
connection_nameValidation
/opt/homebrew/bin/uv run python3 -m unittest tests/test_jinja_macro_contracts.pySNOWFLAKE_ACCOUNT=dummy SNOWFLAKE_USER=dummy DBT_ENV_SECRET_SNOWFLAKE_PASS=dummy SNOWFLAKE_ROLE=dummy SNOWFLAKE_DATABASE=dummy SNOWFLAKE_WAREHOUSE=dummy SNOWFLAKE_SCHEMA=dummy /opt/homebrew/bin/uv run dbt parse --profiles-dir . --target snowflake