Merged
Conversation
bd541d4 to
8f6df7f
Compare
erindru
approved these changes
Jan 20, 2025
Collaborator
erindru
left a comment
There was a problem hiding this comment.
LGTM
Would this change the fingerprint of existing models that had audits?
tobymao
approved these changes
Jan 20, 2025
Collaborator
Author
It does, but I didn't notice it during testing because the old, rendered version of EDIT: after discussing offline, I realized that we can't really heal this with a migration because the snapshot payload would previously contain the following entry for audits: So, there’s no information about using variables whatsoever. The snapshot will still have the rendered date in it, but the local model will now have the |
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.
The motivation behind this PR is that, given this model:
MODEL ( name test_model, kind INCREMENTAL_BY_UNIQUE_KEY ( unique_key (a, d) ), audits ( unique_combination_of_columns( columns = (a, d), condition = d between @start_date and @end_date ) ), ); SELECT 1 AS a, CAST('2025-01-20' AS DATE) AS dThe audit condition renders as follows at runtime today:
The reason this happens is that the model meta is rendered at load time and we store the properties to the corresponding pydantic fields, e.g.
audits, even thoughstart_dateis a variable that changes depending on the runtime stage.Approach is similar to e104491.