Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sqlmesh/core/plan/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,11 @@ def _get_physical_layer_update_stage(
return PhysicalLayerUpdateStage(
snapshots=self._get_snapshots_to_create(plan, snapshots),
all_snapshots=snapshots,
snapshots_with_missing_intervals={s.snapshot_id for s in snapshots_to_intervals},
snapshots_with_missing_intervals={
s.snapshot_id
for s in snapshots_to_intervals
if plan.is_selected_for_backfill(s.name)
},
deployability_index=deployability_index,
)

Expand Down
5 changes: 5 additions & 0 deletions tests/core/test_plan_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def test_build_plan_stages_basic(
snapshot_a.snapshot_id,
snapshot_b.snapshot_id,
}
assert {s.snapshot_id for s in physical_stage.snapshots_with_missing_intervals} == {
snapshot_a.snapshot_id,
snapshot_b.snapshot_id,
}
assert physical_stage.deployability_index == DeployabilityIndex.all_deployable()

# Verify BackfillStage
Expand Down Expand Up @@ -357,6 +361,7 @@ def test_build_plan_stages_select_models(
assert len(physical_stage.snapshots) == 1
assert {s.snapshot_id for s in physical_stage.snapshots} == {snapshot_a.snapshot_id}
assert physical_stage.deployability_index == DeployabilityIndex.all_deployable()
assert physical_stage.snapshots_with_missing_intervals == {snapshot_a.snapshot_id}

# Verify BackfillStage
backfill_stage = stages[2]
Expand Down