Skip to content

Commit

Permalink
SnapShooter: Fixed checking for multi_value on plain attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
xsedla1o committed Aug 9, 2023
1 parent d44bb66 commit f57754a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dp3/snapshots/snapshooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def get_linked_entity_ids(self, entity_type: str, current_values: dict) -> set[t
if (entity_type, attr) not in self.model_spec.relations:
continue
attr_spec = self.model_spec.relations[entity_type, attr]
if attr_spec.multi_value:
if attr_spec.t == AttrType.OBSERVATIONS and attr_spec.multi_value:
related_entity_ids.update((attr_spec.relation_to, v["eid"]) for v in val)
else:
related_entity_ids.add((attr_spec.relation_to, val["eid"]))
Expand All @@ -530,7 +530,7 @@ def link_loaded_entities(self, loaded_entities: dict):
if (entity_type, attr) not in self.model_spec.relations:
continue
attr_spec = self.model_spec.relations[entity_type, attr]
if attr_spec.multi_value:
if attr_spec.t == AttrType.OBSERVATIONS and attr_spec.multi_value:
entity[attr] = [
{
**v,
Expand Down

0 comments on commit f57754a

Please sign in to comment.