Skip to content

Commit 3c9c2c7

Browse files
lafirmthemisvaltinos
authored andcommitted
restructure to add it to uncached (if exists both locally and in prod)
1 parent 1b33216 commit 3c9c2c7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sqlmesh/core/context.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,12 @@ def load(self, update_schemas: bool = True) -> GenericContext[C]:
691691
for snapshot in self.state_reader.get_snapshots(prod.snapshots).values():
692692
if snapshot.node.project in self._projects:
693693
uncached.add(snapshot.name)
694-
elif snapshot.name not in (
695-
set(project.models) | set(project.standalone_audits)
696-
):
697-
store = self._standalone_audits if snapshot.is_audit else self._models
698-
store[snapshot.name] = snapshot.node # type: ignore
694+
else:
695+
local_store = self._standalone_audits if snapshot.is_audit else self._models
696+
if snapshot.name in local_store:
697+
uncached.add(snapshot.name)
698+
else:
699+
local_store[snapshot.name] = snapshot.node # type: ignore
699700

700701
for model in self._models.values():
701702
self.dag.add(model.fqn, model.depends_on)

0 commit comments

Comments
 (0)