We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8164bfb commit 74bd774Copy full SHA for 74bd774
src/zarr/codecs/sharding.py
@@ -265,7 +265,8 @@ async def finalize(
265
) -> Buffer:
266
index_bytes = await index_encoder(self.index)
267
if index_location == ShardingCodecIndexLocation.start:
268
- self.index.offsets_and_lengths[..., 0] += len(index_bytes)
+ empty_chunks_mask = self.index.offsets_and_lengths[..., 0] == MAX_UINT_64
269
+ self.index.offsets_and_lengths[~empty_chunks_mask, 0] += len(index_bytes)
270
index_bytes = await index_encoder(self.index) # encode again with corrected offsets
271
out_buf = index_bytes + self.buf
272
else:
0 commit comments