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
10 changes: 5 additions & 5 deletions sqlmesh/core/plan/explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ def visit_after_all_stage(self, stage: stages.AfterAllStage) -> Tree:
return Tree("[bold]Execute after all statements[/bold]")

def visit_physical_layer_update_stage(self, stage: stages.PhysicalLayerUpdateStage) -> Tree:
if not stage.snapshots:
snapshots = [
s for s in stage.snapshots if s.snapshot_id in stage.snapshots_with_missing_intervals
]
if not snapshots:
return Tree("[bold]SKIP: No physical layer updates to perform[/bold]")

tree = Tree(
"[bold]Validate SQL and create physical layer tables and views if they do not exist[/bold]"
)
for snapshot in stage.snapshots:
if snapshot.snapshot_id not in stage.snapshots_with_missing_intervals:
continue

for snapshot in snapshots:
is_deployable = (
stage.deployability_index.is_deployable(snapshot)
if self.environment_naming_info.name != c.PROD
Expand Down
9 changes: 8 additions & 1 deletion sqlmesh/core/plan/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from sqlmesh.core.snapshot.definition import (
DeployabilityIndex,
Snapshot,
SnapshotChangeCategory,
SnapshotTableInfo,
SnapshotId,
Interval,
Expand Down Expand Up @@ -255,7 +256,13 @@ def build(self, plan: EvaluatablePlan) -> t.List[PlanStage]:
if s.is_paused
and s.is_model
and not s.is_symbolic
and (not deployability_index_for_creation.is_representative(s) or s.is_view)
and (
not deployability_index_for_creation.is_representative(s)
or (
s.is_view
and s.change_category == SnapshotChangeCategory.INDIRECT_NON_BREAKING
)
)
]

snapshots_to_intervals = self._missing_intervals(
Expand Down