Skip to content

Commit af974f8

Browse files
authored
Fix: Create snapshot records before creating physical tables (#4245)
1 parent 6365efb commit af974f8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

sqlmesh/core/plan/evaluator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ def _push(
255255
plan: The plan to source snapshots from.
256256
deployability_index: Indicates which snapshots are deployable in the context of this creation.
257257
"""
258+
self.state_sync.push_snapshots(plan.new_snapshots)
259+
analytics.collector.on_snapshots_created(
260+
new_snapshots=plan.new_snapshots, plan_id=plan.plan_id
261+
)
262+
258263
promoted_snapshot_ids = (
259264
set(plan.environment.promoted_snapshot_ids)
260265
if plan.environment.promoted_snapshot_ids is not None
@@ -300,11 +305,6 @@ def _should_create(s: Snapshot) -> bool:
300305
success=completion_status is not None and completion_status.is_success
301306
)
302307

303-
self.state_sync.push_snapshots(plan.new_snapshots)
304-
305-
analytics.collector.on_snapshots_created(
306-
new_snapshots=plan.new_snapshots, plan_id=plan.plan_id
307-
)
308308
return completion_status
309309

310310
def _promote(

0 commit comments

Comments
 (0)