Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork366
Use atomic writes for new files in LocalStore#3412
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Fixeszarr-developers#3411I use the standard strategy of writing to a temporary file in the samedirectory, and then renaming it to the desired name.This ensure that Zarr writes are either complete or not written at all.
codecovbot commentedAug 27, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #3412 +/- ##==========================================- Coverage 94.70% 94.70% -0.01%========================================== Files 79 79 Lines 9532 9549 +17 ==========================================+ Hits 9027 9043 +16- Misses 505 506 +1
🚀 New features to boost your workflow:
|
| )->int|None: | ||
| path.parent.mkdir(parents=True,exist_ok=True) | ||
| # write takes any object supporting the buffer protocol | ||
| view=value.as_buffer_like() |
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.
this makes me wonder whyBuffer doesn't implement the buffer protocol!
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.
we should probably get arelease note for this change. I'm happy to write one if that works. Otherwise it looks g2g!
The missing code coverage is for the unused/untested |
96a531b intozarr-developers:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Fixes#3411
I use the standard strategy of writing to a temporary file in the same directory, and then renaming it to the desired name. This ensure that Zarr writes are either complete or not written at all.
It would be nice if partial writes (
_put()withstart) could also be atomic, but I'm honestly not sure if both atomic and efficient partial writes of files are possible. Interestingly, I don't see any uses ofset_partial_values()inside Zarr, so maybe this feature isn't needed after all? (see#2859 for discussion)TODO:
changes/