Skip to content

Commit 35b4891

Browse files
committed
handle null shards
1 parent 70a4876 commit 35b4891

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/zarr/core/array.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,11 @@ def shard_grid_shape(self) -> ChunkCoords:
12171217
tuple[int, ...]
12181218
The shape of the shard grid for this array.
12191219
"""
1220-
return tuple(starmap(ceildiv, zip(self.shape, self.shards, strict=True)))
1220+
if self.shards is None:
1221+
shard_shape = self.chunks
1222+
else:
1223+
shard_shape = self.shards
1224+
return tuple(starmap(ceildiv, zip(self.shape, shard_shape, strict=True)))
12211225

12221226
@property
12231227
def nchunks(self) -> int:

0 commit comments

Comments
 (0)