Unclear target class in `dandischema.metadata.migrate()`
- Dominant language
- Python
- Stars
- 7
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
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:
https://github.com/dandi/dandi-schema/blob/f0be5928513652f189fbf8280f8db6c4c99f5a17/dandischema/metadata.py#L435
https://github.com/dandi/dandi-schema/blob/f0be5928513652f189fbf8280f8db6c4c99f5a17/dandischema/metadata.py#L460
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 https://github.com/dandi/dandi-schema/pull/266 is to put in place to enforce more strict validation.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.