Skip to content

Commit 3cb8b32

Browse files
committed
Fix: Report models for which physical table creation was skipped due to a failure upstream (#4308)
1 parent 261133f commit 3cb8b32

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

sqlmesh/core/plan/evaluator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ def _should_create(s: Snapshot) -> bool:
290290
for error in ex.errors:
291291
logger.info(str(error), exc_info=error)
292292

293+
self.console.log_skipped_models({s.name for s in ex.skipped})
293294
self.console.log_failed_models(ex.errors)
294295

295296
raise PlanError("Plan application failed.")

sqlmesh/core/snapshot/evaluator.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,13 @@
8989

9090

9191
class SnapshotCreationFailedError(SQLMeshError):
92-
def __init__(self, errors: t.List[NodeExecutionFailedError[SnapshotId]]):
92+
def __init__(
93+
self, errors: t.List[NodeExecutionFailedError[SnapshotId]], skipped: t.List[SnapshotId]
94+
):
9395
messages = "\n\n".join(f"{error}\n {error.__cause__}" for error in errors)
9496
super().__init__(f"Physical table creation failed:\n\n{messages}")
9597
self.errors = errors
98+
self.skipped = skipped
9699

97100

98101
class SnapshotEvaluator:
@@ -380,7 +383,7 @@ def _create_snapshots(
380383
) -> None:
381384
"""Internal method to create tables in parallel."""
382385
with self.concurrent_context():
383-
errors, _ = concurrent_apply_to_snapshots(
386+
errors, skipped = concurrent_apply_to_snapshots(
384387
snapshots_to_create,
385388
lambda s: self._create_snapshot(
386389
s,
@@ -394,7 +397,7 @@ def _create_snapshots(
394397
raise_on_error=False,
395398
)
396399
if errors:
397-
raise SnapshotCreationFailedError(errors)
400+
raise SnapshotCreationFailedError(errors, skipped)
398401

399402
def migrate(
400403
self,

0 commit comments

Comments
 (0)