4141from sqlmesh .utils .concurrency import NodeExecutionFailedError
4242from sqlmesh .utils .errors import PlanError , SQLMeshError
4343from sqlmesh .utils .dag import DAG
44- from sqlmesh .utils import CorrelationId
4544from sqlmesh .utils .date import now
4645
4746logger = logging .getLogger (__name__ )
@@ -73,7 +72,7 @@ class BuiltInPlanEvaluator(PlanEvaluator):
7372 def __init__ (
7473 self ,
7574 state_sync : StateSync ,
76- create_scheduler : t .Callable [[t .Iterable [Snapshot ], t . Optional [ CorrelationId ] ], Scheduler ],
75+ create_scheduler : t .Callable [[t .Iterable [Snapshot ], SnapshotEvaluator ], Scheduler ],
7776 default_catalog : t .Optional [str ],
7877 console : t .Optional [Console ] = None ,
7978 ):
@@ -231,9 +230,7 @@ def visit_backfill_stage(self, stage: stages.BackfillStage, plan: EvaluatablePla
231230 self .console .log_success ("SKIP: No model batches to execute" )
232231 return
233232
234- scheduler = self .create_scheduler (
235- stage .all_snapshots .values (), CorrelationId .from_plan_id (plan .plan_id )
236- )
233+ scheduler = self .create_scheduler (stage .all_snapshots .values (), self .snapshot_evaluator )
237234 errors , _ = scheduler .run_merged_intervals (
238235 merged_intervals = stage .snapshot_to_intervals ,
239236 deployability_index = stage .deployability_index ,
@@ -254,7 +251,7 @@ def visit_audit_only_run_stage(
254251 return
255252
256253 # If there are any snapshots to be audited, we'll reuse the scheduler's internals to audit them
257- scheduler = self .create_scheduler (audit_snapshots , CorrelationId . from_plan_id ( plan . plan_id ) )
254+ scheduler = self .create_scheduler (audit_snapshots , self . snapshot_evaluator )
258255 completion_status = scheduler .audit (
259256 plan .environment ,
260257 plan .start ,
0 commit comments