Skip to content

Commit

Permalink
More robust field
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Nov 14, 2024
1 parent 438b8ca commit 328dfb8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions odds/common/metadata_store/dataset_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def dataset_factory(data: dict) -> Dataset:
fields = []
for f in resource['fields']:
f.update(json.loads(f.pop('props', None) or '{}'))
f = dict(
(k, v) for k, v in f.items() if k in Field.__dataclass_fields__
)
fields.append(Field(**f))
resource['fields'] = fields
data['resources'] = [resource_factory(**r) for r in resources]
Expand Down

0 comments on commit 328dfb8

Please sign in to comment.