Skip to content

Unclear target class in dandischema.metadata.migrate() #288

@candleindark

Description

@candleindark

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions