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:
|
_validate_obj_json(obj, _get_jsonschema_validator(obj_ver, "Dandiset")) |
|
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.
I noticed that
dandischema.metadata.migrate()is not only used to migrateDandisetobjects butPublishedDandisetobjects as well ( see https://github.com/dandi/dandi-archive/blob/master/dandiapi/api/management/commands/migrate_published_version_metadata.py). However, it seems thatdandischema.metadata.migrate()is hardcoded to handle onlyDandisetobjects, as indicated in the following lines:dandi-schema/dandischema/metadata.py
Line 435 in f0be592
dandi-schema/dandischema/metadata.py
Line 460 in f0be592
That is the expected metadata instance input of the
migrate()function, only instances ofDandiset, not including instances ofPublishedDandiset, or instances ofDandisetand its subclassPublishedDandiset.This problem would be more of an issue if #266 is to put in place to enforce more strict validation.