Skip to content

Commit

Permalink
fix: handle the situation that metadata doesn't have `"assetsSummary"…
Browse files Browse the repository at this point in the history
…` field
  • Loading branch information
candleindark committed Feb 6, 2025
1 parent f3085d0 commit 3a4ebdc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dandischema/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,10 @@ def migrate(
val["schemaKey"] = "AccessRequirements"
for resource in obj_migrated.get("relatedResource", []):
resource["schemaKey"] = "Resource"
if "schemaKey" not in obj_migrated["assetsSummary"]:
if (
"assetsSummary" in obj_migrated
and "schemaKey" not in obj_migrated["assetsSummary"]
):
obj_migrated["assetsSummary"]["schemaKey"] = "AssetsSummary"
if "schemaKey" not in obj_migrated:
obj_migrated["schemaKey"] = "Dandiset"
Expand Down

0 comments on commit 3a4ebdc

Please sign in to comment.