Skip to content

Commit

Permalink
SnapShooter: fix checking for multi_value on plain attributes
Browse files Browse the repository at this point in the history
Fixes:
```
AttributeError: 'AttrSpecPlain' object has no attribute 'multi_value'
```
  • Loading branch information
DavidB137 committed Aug 16, 2023
1 parent ea6977f commit c8695eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dp3/snapshots/snapshooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ def make_snapshot(self, task: Snapshot):
for attr, value in record.items():
if (rtype, attr) not in self.model_spec.relations:
continue
if self.model_spec.relations[rtype, attr].multi_value:
if (
self.model_spec.relations[rtype, attr].t == AttrType.OBSERVATIONS
and self.model_spec.relations[rtype, attr].multi_value
):
record[attr] = [
{k: v for k, v in link_dict.items() if k != "record"} for link_dict in value
]
Expand Down

0 comments on commit c8695eb

Please sign in to comment.