Skip to content

Commit c17fb20

Browse files
committed
Improve message formatting
1 parent f63da5d commit c17fb20

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
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: 9 additions & 10 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
)
@@ -635,17 +634,15 @@ def _run_or_audit(
635634
for s_id, interval in (remove_intervals or {}).items():
636635
self.snapshots[s_id].remove_interval(interval)
637636

638-
auto_restated_intervals: t.List[SnapshotIntervals] = []
639-
auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {}
637+
all_auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {}
640638
if auto_restatement_enabled:
641-
auto_restated_intervals, auto_restatement_triggers = apply_auto_restatements(
639+
auto_restated_intervals, all_auto_restatement_triggers = apply_auto_restatements(
642640
self.snapshots, execution_time
643641
)
644642
self.state_sync.add_snapshots_intervals(auto_restated_intervals)
645643
self.state_sync.update_auto_restatements(
646644
{s.name_version: s.next_auto_restatement_ts for s in self.snapshots.values()}
647645
)
648-
auto_restated_snapshots = {snapshot.snapshot_id for snapshot in auto_restated_intervals}
649646

650647
merged_intervals = self.merged_missing_intervals(
651648
start,
@@ -662,11 +659,13 @@ def _run_or_audit(
662659
if not merged_intervals:
663660
return CompletionStatus.NOTHING_TO_DO
664661

665-
merged_intervals_snapshots = {snapshot.snapshot_id for snapshot in merged_intervals}
666-
667-
auto_restatement_triggers_dict: t.Dict[SnapshotId, t.List[SnapshotId]] = {
668-
s_id: auto_restatement_triggers.get(s_id, []) for s_id in merged_intervals_snapshots
669-
}
662+
auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {}
663+
if all_auto_restatement_triggers:
664+
merged_intervals_snapshots = {snapshot.snapshot_id for snapshot in merged_intervals}
665+
auto_restatement_triggers = {
666+
s_id: all_auto_restatement_triggers.get(s_id, [])
667+
for s_id in merged_intervals_snapshots
668+
}
670669

671670
errors, _ = self.run_merged_intervals(
672671
merged_intervals=merged_intervals,

0 commit comments

Comments
 (0)