Skip to content

Commit 44ebb55

Browse files
committed
Improve message formatting
1 parent 50ca148 commit 44ebb55

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
@@ -31,7 +31,6 @@
3131
from sqlmesh.core.snapshot.definition import check_ready_intervals
3232
from sqlmesh.core.snapshot.definition import (
3333
Interval,
34-
SnapshotIntervals,
3534
expand_range,
3635
parent_snapshots_by_name,
3736
)
@@ -740,17 +739,15 @@ def _run_or_audit(
740739
for s_id, interval in (remove_intervals or {}).items():
741740
self.snapshots[s_id].remove_interval(interval)
742741

743-
auto_restated_intervals: t.List[SnapshotIntervals] = []
744-
auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {}
742+
all_auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {}
745743
if auto_restatement_enabled:
746-
auto_restated_intervals, auto_restatement_triggers = apply_auto_restatements(
744+
auto_restated_intervals, all_auto_restatement_triggers = apply_auto_restatements(
747745
self.snapshots, execution_time
748746
)
749747
self.state_sync.add_snapshots_intervals(auto_restated_intervals)
750748
self.state_sync.update_auto_restatements(
751749
{s.name_version: s.next_auto_restatement_ts for s in self.snapshots.values()}
752750
)
753-
auto_restated_snapshots = {snapshot.snapshot_id for snapshot in auto_restated_intervals}
754751

755752
merged_intervals = self.merged_missing_intervals(
756753
start,
@@ -767,11 +764,13 @@ def _run_or_audit(
767764
if not merged_intervals:
768765
return CompletionStatus.NOTHING_TO_DO
769766

770-
merged_intervals_snapshots = {snapshot.snapshot_id for snapshot in merged_intervals}
771-
772-
auto_restatement_triggers_dict: t.Dict[SnapshotId, t.List[SnapshotId]] = {
773-
s_id: auto_restatement_triggers.get(s_id, []) for s_id in merged_intervals_snapshots
774-
}
767+
auto_restatement_triggers: t.Dict[SnapshotId, t.List[SnapshotId]] = {}
768+
if all_auto_restatement_triggers:
769+
merged_intervals_snapshots = {snapshot.snapshot_id for snapshot in merged_intervals}
770+
auto_restatement_triggers = {
771+
s_id: all_auto_restatement_triggers.get(s_id, [])
772+
for s_id in merged_intervals_snapshots
773+
}
775774

776775
errors, _ = self.run_merged_intervals(
777776
merged_intervals=merged_intervals,

0 commit comments

Comments
 (0)