Skip to content

Commit 36310f0

Browse files
committed
Improve message formatting
1 parent 175d35f commit 36310f0

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

sqlmesh/core/console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3817,7 +3817,7 @@ def update_snapshot_evaluation_progress(
38173817
message = f"Evaluated {snapshot.name} | batch={batch_idx} | duration={duration_ms}ms | num_audits_passed={num_audits_passed} | num_audits_failed={num_audits_failed}"
38183818

38193819
if auto_restatement_triggers:
3820-
message += f" | Auto-restatement triggers {', '.join(trigger.name for trigger in auto_restatement_triggers)}"
3820+
message += f" | auto_restatement_triggers=[{', '.join(trigger.name for trigger in auto_restatement_triggers)}]"
38213821

38223822
if audit_only:
38233823
message = f"Audited {snapshot.name} | duration={duration_ms}ms | num_audits_passed={num_audits_passed} | num_audits_failed={num_audits_failed}"

sqlmesh/core/scheduler.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from sqlmesh.core.snapshot.definition import check_ready_intervals
3030
from sqlmesh.core.snapshot.definition import (
3131
Interval,
32-
SnapshotIntervals,
3332
expand_range,
3433
parent_snapshots_by_name,
3534
)
@@ -642,17 +641,15 @@ def _run_or_audit(
642641
for s_id, interval in (remove_intervals or {}).items():
643642
self.snapshots[s_id].remove_interval(interval)
644643

645-
auto_restated_intervals: t.List[SnapshotIntervals] = []
646-
auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {}
644+
all_auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {}
647645
if auto_restatement_enabled:
648-
auto_restated_intervals, auto_restatement_triggers = apply_auto_restatements(
646+
auto_restated_intervals, all_auto_restatement_triggers = apply_auto_restatements(
649647
self.snapshots, execution_time
650648
)
651649
self.state_sync.add_snapshots_intervals(auto_restated_intervals)
652650
self.state_sync.update_auto_restatements(
653651
{s.name_version: s.next_auto_restatement_ts for s in self.snapshots.values()}
654652
)
655-
auto_restated_snapshots = {snapshot.snapshot_id for snapshot in auto_restated_intervals}
656653

657654
merged_intervals = self.merged_missing_intervals(
658655
start,
@@ -670,9 +667,8 @@ def _run_or_audit(
670667
return CompletionStatus.NOTHING_TO_DO
671668

672669
merged_intervals_snapshots = {snapshot.snapshot_id for snapshot in merged_intervals}
673-
674-
auto_restatement_triggers_dict: t.Dict[SnapshotId, t.List[SnapshotId]] = {
675-
s_id: auto_restatement_triggers.get(s_id, []) for s_id in merged_intervals_snapshots
670+
auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {
671+
s_id: all_auto_restatement_triggers.get(s_id, []) for s_id in merged_intervals_snapshots
676672
}
677673

678674
errors, _ = self.run_merged_intervals(
@@ -686,7 +682,7 @@ def _run_or_audit(
686682
run_environment_statements=run_environment_statements,
687683
audit_only=audit_only,
688684
restatements=remove_intervals,
689-
auto_restatement_triggers=auto_restatement_triggers_dict,
685+
auto_restatement_triggers=auto_restatement_triggers,
690686
)
691687

692688
return CompletionStatus.FAILURE if errors else CompletionStatus.SUCCESS

0 commit comments

Comments
 (0)