Skip to content

Commit ed1ba06

Browse files
committed
Store audit results via callback rather than local console reference
1 parent c110855 commit ed1ba06

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

sqlmesh/core/scheduler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def evaluate(
168168
batch_index: int,
169169
environment_naming_info: EnvironmentNamingInfo,
170170
default_catalog: t.Optional[str],
171+
on_audits_complete: t.Optional[t.Callable[[Snapshot, t.List[AuditResult]], None]] = None,
172+
on_audit_warning: t.Optional[t.Callable[[str, t.Optional[str]], None]] = None,
171173
**kwargs: t.Any,
172174
) -> t.Tuple[t.List[AuditResult], t.List[AuditError]]:
173175
"""Evaluate a snapshot and add the processed interval to the state sync.
@@ -211,7 +213,8 @@ def evaluate(
211213
wap_id=wap_id,
212214
**kwargs,
213215
)
214-
get_console().store_evaluation_audit_results(snapshot, audit_results)
216+
if on_audits_complete:
217+
on_audits_complete(snapshot, audit_results)
215218

216219
audit_errors_to_raise: t.List[AuditError] = []
217220
audit_errors_to_warn: t.List[AuditError] = []

0 commit comments

Comments
 (0)