|
118 | 118 | filter_tests_by_patterns, |
119 | 119 | ) |
120 | 120 | from sqlmesh.core.user import User |
121 | | -from sqlmesh.utils import UniqueKeyDict, Verbosity |
| 121 | +from sqlmesh.utils import CorrelationId, UniqueKeyDict, Verbosity |
122 | 122 | from sqlmesh.utils.concurrency import concurrent_apply_to_values |
123 | 123 | from sqlmesh.utils.dag import DAG |
124 | 124 | from sqlmesh.utils.date import ( |
@@ -811,6 +811,9 @@ def run( |
811 | 811 | engine_type=self.snapshot_evaluator.adapter.dialect, |
812 | 812 | state_sync_type=self.state_sync.state_type(), |
813 | 813 | ) |
| 814 | + snapshot_evaluator = self.snapshot_evaluator.set_correlation_id( |
| 815 | + CorrelationId.from_run_id(analytics_run_id) |
| 816 | + ) |
814 | 817 | self._load_materializations() |
815 | 818 |
|
816 | 819 | env_check_attempts_num = max( |
@@ -863,6 +866,7 @@ def _has_environment_changed() -> bool: |
863 | 866 | select_models=select_models, |
864 | 867 | circuit_breaker=_has_environment_changed, |
865 | 868 | no_auto_upstream=no_auto_upstream, |
| 869 | + snapshot_evaluator=snapshot_evaluator, |
866 | 870 | ) |
867 | 871 | done = True |
868 | 872 | except CircuitBreakerError: |
@@ -2586,8 +2590,9 @@ def _run( |
2586 | 2590 | select_models: t.Optional[t.Collection[str]], |
2587 | 2591 | circuit_breaker: t.Optional[t.Callable[[], bool]], |
2588 | 2592 | no_auto_upstream: bool, |
| 2593 | + snapshot_evaluator: t.Optional[SnapshotEvaluator] = None, |
2589 | 2594 | ) -> CompletionStatus: |
2590 | | - scheduler = self.scheduler(environment=environment) |
| 2595 | + scheduler = self.scheduler(environment=environment, snapshot_evaluator=snapshot_evaluator) |
2591 | 2596 | snapshots = scheduler.snapshots |
2592 | 2597 |
|
2593 | 2598 | if select_models is not None: |
|
0 commit comments