We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a732ae commit 08cd4ebCopy full SHA for 08cd4eb
1 file changed
sqlmesh/core/plan/evaluator.py
@@ -400,7 +400,13 @@ def _restatement_intervals_across_all_environments(
400
401
snapshots_to_restate: t.Dict[SnapshotId, t.Tuple[SnapshotTableInfo, Interval]] = {}
402
403
- for env in self.state_sync.get_environments():
+ for env_summary in self.state_sync.get_environments_summary():
404
+ # Fetch the full environment object one at a time to avoid loading all environments into memory at once
405
+ env = self.state_sync.get_environment(env_summary.name)
406
+ if not env:
407
+ logger.warning("Environment %s not found", env_summary.name)
408
+ continue
409
+
410
keyed_snapshots = {s.name: s.table_info for s in env.snapshots}
411
412
# We dont just restate matching snapshots, we also have to restate anything downstream of them
0 commit comments