-
Notifications
You must be signed in to change notification settings - Fork 25
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
Mint Zarr assets at start of upload and sync Zarr contents #907
Conversation
Codecov Report
@@ Coverage Diff @@
## master #907 +/- ##
==========================================
+ Coverage 86.79% 87.38% +0.58%
==========================================
Files 61 61
Lines 7424 7453 +29
==========================================
+ Hits 6444 6513 +69
+ Misses 980 940 -40
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
looks good. seems in need of test tune up to trigger "delete" logic coverage
While testing, I hit a 409 error when trying to upload a file to a path that was previously a directory, even after deleting all of the directory's files:
@dchiquito What is the proper way to delete a directory inside a Zarr on the server? EDIT: Never mind, my mistake, though I'd still be interested in if there's a better way to delete a directory than deleting all its contents individually. |
the only thing i can think of is a dandi api request that launches a task that internally lists all objects with a given prefix, and then deletes all of them. this can take a while though for zarr trees and we have to be careful on what that prefix can be for a request. |
@@ -1707,6 +1711,8 @@ def get_digest(self) -> Digest: | |||
|
|||
:raises NotFoundError: if the path does not exist in the Zarr asset | |||
""" | |||
if self._digest is not None: | |||
return self._digest |
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.
what is the "life cycle" of this ._digest
? :
- I do not see it just being a lazy one (not assigned below in this function)
- digests of zarr could change on remote/server since zarr files are mutable, so aren't we doomed to query it every time
.digest
is requested?
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.
oh, the latter is a wrong question since we are talking here about RemoteZarrEntry not an entire Zarr. But still not certain about what should set ._digest
?
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.
_digest
is set by _get_subpath()
when called by iterdir()
, in which case the code is going through a Zarr listing with checksums, so storing the entry's checksum saves a potential HTTP request later. _digest
can be unset by the cache_clear()
method.
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.
so is it the get_listing
below which would set it? this is all makes it not obvious, and worth at least a comment here.
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.
Comment added.
@jwodder - please resolve freshly came up conflict and let's merge to carry forward |
@yarikoptic Conflict resolved. |
ok, still green, let's proceed. thanks @jwodder ! |
Closes #884.
Closes #906.