Skip to content

Commit bbde8af

Browse files
authored
Fix: Hydrate seeds when fetching modified stored models (#990)
1 parent 70fd198 commit bbde8af

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

sqlmesh/core/context_diff.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,22 @@ def create(
9494
if name not in added and snapshot.fingerprint != existing_info[name].fingerprint
9595
}
9696

97+
modified_local_seed_snapshot_ids = {
98+
s.snapshot_id for s in snapshots.values() if s.is_seed and s.name in modified_info
99+
}
100+
modified_remote_snapshot_ids = {s.snapshot_id for s in modified_info.values()}
101+
97102
stored = {
98-
**state_reader.get_snapshots([snapshot.snapshot_id for snapshot in snapshots.values()]),
99-
**state_reader.get_snapshots(modified_info.values(), hydrate_seeds=True),
103+
**state_reader.get_snapshots(
104+
[
105+
snapshot.snapshot_id
106+
for snapshot in snapshots.values()
107+
if snapshot.snapshot_id not in modified_local_seed_snapshot_ids
108+
]
109+
),
110+
**state_reader.get_snapshots(
111+
modified_remote_snapshot_ids | modified_local_seed_snapshot_ids, hydrate_seeds=True
112+
),
100113
}
101114

102115
merged_snapshots = {}

0 commit comments

Comments
 (0)