feat: add SupportsSetRange protocol and store implementations#3907
Open
d-v-b wants to merge 4 commits intozarr-developers:mainfrom
Open
feat: add SupportsSetRange protocol and store implementations#3907d-v-b wants to merge 4 commits intozarr-developers:mainfrom
d-v-b wants to merge 4 commits intozarr-developers:mainfrom
Conversation
Add SupportsSetRange protocol for stores that support writing to a byte range within an existing value (set_range/set_range_sync). Implement in MemoryStore and LocalStore, both explicitly subclassing the protocol. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3907 +/- ##
=======================================
Coverage 93.08% 93.09%
=======================================
Files 85 85
Lines 11230 11264 +34
=======================================
+ Hits 10454 10486 +32
- Misses 776 778 +2
🚀 New features to boost your workflow:
|
Tests cover isinstance check, async set_range, sync set_range_sync, and edge case (writing at end of value). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a protocol for stores that support synchronously and asynchronously writing a bytes into a range in the target object. only
MemoryStoreandLocalStoreimplement this.this behavior is necessary to enable an in-place writing mode for shards, e.g. where a single subchunk is written without re-writing the entire shard.