Skip to content

Fix: Make jinja_macros optional for environment statements#4072

Merged
themisvaltinos merged 2 commits intomainfrom
themis/fix_environment_statements
Apr 2, 2025
Merged

Fix: Make jinja_macros optional for environment statements#4072
themisvaltinos merged 2 commits intomainfrom
themis/fix_environment_statements

Conversation

@themisvaltinos
Copy link
Contributor

Make jinja_macros optional for environment statements to ensure they don't cause extra diffs when running plan in latest versions of pydantic ( > 2.10 ).

dialect,
[],
jinja_macro_registry=jinja_macros or JinjaMacroRegistry(),
jinja_macro_registry=jinja_macros or None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This... seems suspect. Why did it need to change?

Copy link
Contributor Author

@themisvaltinos themisvaltinos Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it didn't need to change. I thought there was no need to carry an empty jinja macro registry dict for sqlmesh projects so only have it for the dbt projects that actually use them

Copy link
Collaborator

@erindru erindru Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, thanks, I get it now.

But isnt jinja_macros or None the same as jinja_macros because the parameter is already defined as t.Optional[JinjaMacroRegistry] ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh you're right. I should have had it like that from the beginning since this was already handled inside the Renderer

@themisvaltinos themisvaltinos merged commit b8d9c17 into main Apr 2, 2025
22 checks passed
@themisvaltinos themisvaltinos deleted the themis/fix_environment_statements branch April 2, 2025 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants