Skip to content

Commit d4f98c7

Browse files
kkollsgaclaude
andcommitted
Fix mypy type error in _is_full_shard_selection
Add isinstance check for tuple since SelectorTuple can also be ndarray or slice. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8707ca9 commit d4f98c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/zarr/codecs/sharding.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ def _is_full_shard_selection(selection: SelectorTuple, shard_shape: tuple[int, .
9999
bool
100100
True if selection covers the entire shard, False otherwise
101101
"""
102+
# SelectorTuple can be a tuple, ndarray, or slice
103+
# Only tuple selections can potentially cover a full shard
104+
if not isinstance(selection, tuple):
105+
return False
106+
102107
if len(selection) != len(shard_shape):
103108
return False
104109

0 commit comments

Comments
 (0)