Fix!: Add model default audits in the model preserving their args#5106
Merged
themisvaltinos merged 3 commits intomainfrom Aug 8, 2025
Merged
Fix!: Add model default audits in the model preserving their args#5106themisvaltinos merged 3 commits intomainfrom
themisvaltinos merged 3 commits intomainfrom
Conversation
izeigerman
reviewed
Aug 7, 2025
izeigerman
reviewed
Aug 7, 2025
7d17281 to
2ba5350
Compare
Contributor
Author
|
addressed comments and merged audits before passing to klass let me know if this looks better @izeigerman |
izeigerman
reviewed
Aug 7, 2025
sqlmesh/core/model/definition.py
Outdated
| model_audits = kwargs.pop("audits", []) | ||
| default_audits = defaults.pop("audits", []) | ||
|
|
||
| if isinstance(model_audits, (exp.Tuple, exp.Array)): |
Contributor
There was a problem hiding this comment.
This block looks like something that could be an utility function and doesn't have to be a part of _create_model
izeigerman
approved these changes
Aug 7, 2025
Contributor
izeigerman
left a comment
There was a problem hiding this comment.
Housekeeping comment, LGTM otherwise
2ba5350 to
3919ba7
Compare
3919ba7 to
a392ee4
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 ensures that audit arguments from default_audits are no longer dropped when model audits are present.
Previously, if a model defined its own audits, only those were retained and the arguments from default_audits were silently dropped (since we used the audit_definitions with empty args). This adds both in the model's audits, preserving them along with their arguments.