-
Notifications
You must be signed in to change notification settings - Fork 13
Description
I noticed that dandischema.metadata.migrate()
is not only used to migrate Dandiset
objects but PublishedDandiset
objects as well ( see https://github.com/dandi/dandi-archive/blob/master/dandiapi/api/management/commands/migrate_published_version_metadata.py). However, it seems that dandischema.metadata.migrate()
is hardcoded to handle only Dandiset
objects, as indicated in the following lines:
dandi-schema/dandischema/metadata.py
Line 435 in f0be592
_validate_obj_json(obj, _get_jsonschema_validator(obj_ver, "Dandiset")) |
dandi-schema/dandischema/metadata.py
Line 460 in f0be592
obj_migrated["schemaKey"] = "Dandiset" |
That is the expected metadata instance input of the migrate()
function, only instances of Dandiset
, not including instances of PublishedDandiset
, or instances of Dandiset
and its subclass PublishedDandiset
.
This problem would be more of an issue if #266 is to put in place to enforce more strict validation.