Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
candleindark opened this issue Feb 20, 2025 · 0 comments
Open

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

candleindark opened this issue Feb 20, 2025 · 0 comments

Comments

@candleindark
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant