-
Notifications
You must be signed in to change notification settings - Fork 15
Introduce ContentType as Blob vs Zarr and rename blobDateModified to contentDateModified #220
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -300,6 +300,18 @@ def migrate( | |
| if "schemaKey" not in obj: | ||
| obj["schemaKey"] = "Dandiset" | ||
| obj["schemaVersion"] = to_version | ||
| if version2tuple(schema_version) < version2tuple("0.7.0"): | ||
| if "blobDateModified" in obj: | ||
| obj["contentDateModified"] = obj.pop("blobDateModified") | ||
| # we need to deduce what type of content we have | ||
| obj["contentType"] = ( | ||
| models.ContentType.Zarr | ||
| if ( | ||
| obj.get("encodingFormat") == "application/x-zarr" | ||
| or obj.get("path", "").endswith(".zarr") | ||
| ) | ||
| else models.ContentType.Blob | ||
| ) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not yet 100% certain since we have only 2 cases -- it is either zarr or not (blob), but this field and code would be the "centralization" of the logic for DANDI-specific behavior of zarr-vs-blob. Otherwise, if we add some other "contentType" later on (e.g. |
||
| return obj | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here will need to become some future version now that 0.7.0 is out... we might want to introduce
nextbranch alike tonextin linux development, or more specificallynext-0.8.0and position this PR against it so we could absorb meanwhile non-breaking changes