Fix: Selectively widen restatement intervals if they affect a downstream model that cannot be partially restated #3902
+161
−3
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.
Prior to this PR, if you had something like
A [incremental_by_time_range] <- B[incremental_by_unique_key]
and tried to restate a part of A, B would only be fully restated if it was inprod
.If B was in a dev environment, then it would be partially restated even though it's a model type that doesn't support partial restatement. If B was later promoted to
prod
, then this could lead to incorrect data inprod
.This PR adjusts the logic to, when calculating restatement intervals based on
SnapshotTableInfo
, if any of the affected snapshots are "full restatement only" then the full snapshot records are fetched from state so that the restatement intervals can be widened correctly.