|
30 | 30 | from sqlmesh.core.environment import EnvironmentNamingInfo |
31 | 31 | from sqlmesh.core.linter.rule import RuleViolation |
32 | 32 | from sqlmesh.core.model import Model |
| 33 | +from sqlmesh.core.model.definition import AuditResult |
33 | 34 | from sqlmesh.core.snapshot import ( |
34 | 35 | Snapshot, |
35 | 36 | SnapshotChangeCategory, |
@@ -96,6 +97,12 @@ def start_plan_evaluation(self, plan: EvaluatablePlan) -> None: |
96 | 97 | def stop_plan_evaluation(self) -> None: |
97 | 98 | """Indicates that the evaluation has ended.""" |
98 | 99 |
|
| 100 | + @abc.abstractmethod |
| 101 | + def store_evaluation_audit_results( |
| 102 | + self, snapshot: Snapshot, audit_results: t.List[AuditResult] |
| 103 | + ) -> None: |
| 104 | + """Stores the audit results for the snapshot evaluation.""" |
| 105 | + |
99 | 106 | @abc.abstractmethod |
100 | 107 | def start_evaluation_progress( |
101 | 108 | self, |
@@ -413,6 +420,11 @@ def start_plan_evaluation(self, plan: EvaluatablePlan) -> None: |
413 | 420 | def stop_plan_evaluation(self) -> None: |
414 | 421 | pass |
415 | 422 |
|
| 423 | + def store_evaluation_audit_results( |
| 424 | + self, snapshot: Snapshot, audit_results: t.List[AuditResult] |
| 425 | + ) -> None: |
| 426 | + pass |
| 427 | + |
416 | 428 | def start_evaluation_progress( |
417 | 429 | self, |
418 | 430 | batch_sizes: t.Dict[Snapshot, int], |
@@ -678,6 +690,7 @@ def __init__( |
678 | 690 | self.evaluation_total_task: t.Optional[TaskID] = None |
679 | 691 | self.evaluation_model_progress: t.Optional[Progress] = None |
680 | 692 | self.evaluation_model_tasks: t.Dict[str, TaskID] = {} |
| 693 | + self.evaluation_model_batch_sizes: t.Dict[Snapshot, int] = {} |
681 | 694 |
|
682 | 695 | # Put in temporary values that are replaced when evaluating |
683 | 696 | self.environment_naming_info = EnvironmentNamingInfo() |
@@ -726,6 +739,11 @@ def start_plan_evaluation(self, plan: EvaluatablePlan) -> None: |
726 | 739 | def stop_plan_evaluation(self) -> None: |
727 | 740 | pass |
728 | 741 |
|
| 742 | + def store_evaluation_audit_results( |
| 743 | + self, snapshot: Snapshot, audit_results: t.List[AuditResult] |
| 744 | + ) -> None: |
| 745 | + self.evaluation_audit_results[snapshot] = audit_results |
| 746 | + |
729 | 747 | def start_evaluation_progress( |
730 | 748 | self, |
731 | 749 | batch_sizes: t.Dict[Snapshot, int], |
|
0 commit comments