Feat: Add support for pre, post, on_virtual_update statements in config#4995
Merged
themisvaltinos merged 4 commits intomainfrom Jul 24, 2025
Merged
Feat: Add support for pre, post, on_virtual_update statements in config#4995themisvaltinos merged 4 commits intomainfrom
themisvaltinos merged 4 commits intomainfrom
Conversation
izeigerman
approved these changes
Jul 24, 2025
georgesittas
approved these changes
Jul 24, 2025
tests/core/test_context.py
Outdated
| # Verify statements are in the model and python environment has been popuplated | ||
| assert len(model.pre_statements) == 2 | ||
| assert len(model.post_statements) == 1 | ||
| assert model.python_env["__sqlmesh__vars__"].payload == "{'var1': 4}" |
Contributor
There was a problem hiding this comment.
Suggested change
| assert model.python_env["__sqlmesh__vars__"].payload == "{'var1': 4}" | |
| assert model.python_env[c.SQLMESH_VARS].payload == "{'var1': 4}" |
78949d4 to
91b64f4
Compare
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.
This update enables defining
pre_statements,post_statementsandon_virtual_updatestatements at the project level in the configuration that will be applied to all models.Example:
These default statements are merged with any model-specific statements, with default statements executing first followed by the model-specific ones.