Skip to content

Commit 511f2a7

Browse files
committed
self review
1 parent 28c17d7 commit 511f2a7

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/zarr/codecs/sharding.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ async def get_partial_values(
105105
prototype: BufferPrototype,
106106
byte_ranges: Iterable[ByteRequest | None],
107107
) -> list[Buffer | None]:
108-
return [await self.get(prototype, br) for br in byte_ranges]
108+
# Concurrency not needed, each .get() is a slice of an in-memory buffer.
109+
return [await self.get(prototype, byte_range) for byte_range in byte_ranges]
109110

110111

111112
@dataclass(frozen=True)
@@ -482,7 +483,7 @@ async def _decode_partial_single(
482483
all_chunk_coords = {chunk_coords for chunk_coords, *_ in indexed_chunks}
483484

484485
# reading bytes of all requested chunks
485-
shard_dict_maybe: ShardMapping | None = None
486+
shard_dict_maybe: ShardMapping | None
486487
if self._is_total_shard(all_chunk_coords, chunks_per_shard):
487488
# read entire shard
488489
shard_dict_maybe = await self._load_full_shard_maybe(

src/zarr/storage/_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async def get_partial_values(
190190
The read bytes for each range, or None for missing keys.
191191
"""
192192
return await self.store.get_partial_values(
193-
prototype, [(self.path, br) for br in byte_ranges]
193+
prototype, [(self.path, byte_range) for byte_range in byte_ranges]
194194
)
195195

196196
async def set(self, value: Buffer) -> None:

0 commit comments

Comments
 (0)