|
29 | 29 | from sqlmesh.core.environment import EnvironmentNamingInfo |
30 | 30 | from sqlmesh.core.linter.rule import RuleViolation |
31 | 31 | from sqlmesh.core.model import Model |
| 32 | +from sqlmesh.core.model.definition import AuditResult |
32 | 33 | from sqlmesh.core.snapshot import ( |
33 | 34 | Snapshot, |
34 | 35 | SnapshotChangeCategory, |
@@ -93,6 +94,12 @@ def start_plan_evaluation(self, plan: EvaluatablePlan) -> None: |
93 | 94 | def stop_plan_evaluation(self) -> None: |
94 | 95 | """Indicates that the evaluation has ended.""" |
95 | 96 |
|
| 97 | + @abc.abstractmethod |
| 98 | + def store_evaluation_audit_results( |
| 99 | + self, snapshot: Snapshot, audit_results: t.List[AuditResult] |
| 100 | + ) -> None: |
| 101 | + """Stores the audit results for the snapshot evaluation.""" |
| 102 | + |
96 | 103 | @abc.abstractmethod |
97 | 104 | def start_evaluation_progress( |
98 | 105 | self, |
@@ -350,6 +357,11 @@ def start_plan_evaluation(self, plan: EvaluatablePlan) -> None: |
350 | 357 | def stop_plan_evaluation(self) -> None: |
351 | 358 | pass |
352 | 359 |
|
| 360 | + def store_evaluation_audit_results( |
| 361 | + self, snapshot: Snapshot, audit_results: t.List[AuditResult] |
| 362 | + ) -> None: |
| 363 | + pass |
| 364 | + |
353 | 365 | def start_evaluation_progress( |
354 | 366 | self, |
355 | 367 | batch_sizes: t.Dict[Snapshot, int], |
@@ -560,6 +572,7 @@ def __init__( |
560 | 572 | self.evaluation_total_task: t.Optional[TaskID] = None |
561 | 573 | self.evaluation_model_progress: t.Optional[Progress] = None |
562 | 574 | self.evaluation_model_tasks: t.Dict[str, TaskID] = {} |
| 575 | + self.evaluation_model_batch_sizes: t.Dict[Snapshot, int] = {} |
563 | 576 |
|
564 | 577 | # Put in temporary values that are replaced when evaluating |
565 | 578 | self.environment_naming_info = EnvironmentNamingInfo() |
@@ -598,6 +611,11 @@ def start_plan_evaluation(self, plan: EvaluatablePlan) -> None: |
598 | 611 | def stop_plan_evaluation(self) -> None: |
599 | 612 | pass |
600 | 613 |
|
| 614 | + def store_evaluation_audit_results( |
| 615 | + self, snapshot: Snapshot, audit_results: t.List[AuditResult] |
| 616 | + ) -> None: |
| 617 | + self.evaluation_audit_results[snapshot] = audit_results |
| 618 | + |
601 | 619 | def start_evaluation_progress( |
602 | 620 | self, |
603 | 621 | batch_sizes: t.Dict[Snapshot, int], |
|
0 commit comments