Skip to content

Commit e58f657

Browse files
committed
Remove create_scheduler refactor
1 parent 6650dd0 commit e58f657

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

sqlmesh/core/context.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,9 @@ def scheduler(self, environment: t.Optional[str] = None) -> Scheduler:
535535
if not snapshots:
536536
raise ConfigError("No models were found")
537537

538-
return self.create_scheduler(snapshots, self.snapshot_evaluator)
538+
return self.create_scheduler(snapshots)
539539

540-
def create_scheduler(
541-
self, snapshots: t.Iterable[Snapshot], snapshot_evaluator: SnapshotEvaluator
542-
) -> Scheduler:
540+
def create_scheduler(self, snapshots: t.Iterable[Snapshot]) -> Scheduler:
543541
"""Creates the built-in scheduler.
544542
545543
Args:
@@ -550,7 +548,7 @@ def create_scheduler(
550548
"""
551549
return Scheduler(
552550
snapshots,
553-
snapshot_evaluator,
551+
self.snapshot_evaluator,
554552
self.state_sync,
555553
default_catalog=self.default_catalog,
556554
max_workers=self.concurrent_tasks,

sqlmesh/core/plan/evaluator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171
self,
7272
state_sync: StateSync,
7373
snapshot_evaluator: SnapshotEvaluator,
74-
create_scheduler: t.Callable[[t.Iterable[Snapshot], SnapshotEvaluator], Scheduler],
74+
create_scheduler: t.Callable[[t.Iterable[Snapshot]], Scheduler],
7575
default_catalog: t.Optional[str],
7676
console: t.Optional[Console] = None,
7777
):
@@ -228,7 +228,7 @@ def visit_backfill_stage(self, stage: stages.BackfillStage, plan: EvaluatablePla
228228
self.console.log_success("SKIP: No model batches to execute")
229229
return
230230

231-
scheduler = self.create_scheduler(stage.all_snapshots.values(), self.snapshot_evaluator)
231+
scheduler = self.create_scheduler(stage.all_snapshots.values())
232232
errors, _ = scheduler.run_merged_intervals(
233233
merged_intervals=stage.snapshot_to_intervals,
234234
deployability_index=stage.deployability_index,
@@ -249,7 +249,7 @@ def visit_audit_only_run_stage(
249249
return
250250

251251
# If there are any snapshots to be audited, we'll reuse the scheduler's internals to audit them
252-
scheduler = self.create_scheduler(audit_snapshots, self.snapshot_evaluator)
252+
scheduler = self.create_scheduler(audit_snapshots)
253253
completion_status = scheduler.audit(
254254
plan.environment,
255255
plan.start,

0 commit comments

Comments
 (0)