Skip to content

Commit c752c28

Browse files
committed
Ensure we have full snapshots for all demoted snapshot table infos
1 parent 20a5936 commit c752c28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sqlmesh/core/plan/stages.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,14 @@ def build(self, plan: EvaluatablePlan) -> t.List[PlanStage]:
361361
# Otherwise, unpause right after updatig the environment record.
362362
stages.append(UnpauseStage(promoted_snapshots=promoted_snapshots))
363363

364+
full_demoted_snapshots = self.state_reader.get_snapshots(
365+
s.snapshot_id for s in demoted_snapshots if s.snapshot_id not in snapshots
366+
)
364367
virtual_layer_update_stage = self._get_virtual_layer_update_stage(
365368
promoted_snapshots,
366369
demoted_snapshots,
367370
demoted_environment_naming_info,
368-
snapshots,
371+
snapshots | full_demoted_snapshots,
369372
deployability_index,
370373
)
371374
if virtual_layer_update_stage:

0 commit comments

Comments
 (0)