Skip to content

Commit 4f332c4

Browse files
author
Cipher
committed
fix(mypy): add type ignore comments for dynamic array indexing in sharding test
The test uses complex indexing patterns (mixed integer/list indices) that mypy's zarr.Array stubs don't recognize as valid. Add specific type ignore comments for [index] and [union-attr] errors to suppress false positives.
1 parent 07b6fb7 commit 4f332c4

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

tests/test_codecs/test_sharding.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -537,21 +537,21 @@ def test_sharding_mixed_integer_list_indexing(store: Store) -> None:
537537
sharded[:, :, :] = data
538538

539539
# Mixed integer + list indexing
540-
c = chunked[0:10, 0, [0, 1]]
541-
s = sharded[0:10, 0, [0, 1]]
542-
assert c.shape == s.shape == (10, 2), (
543-
f"Expected (10, 2), got chunked={c.shape}, sharded={s.shape}"
540+
c = chunked[0:10, 0, [0, 1]] # type: ignore[index]
541+
s = sharded[0:10, 0, [0, 1]] # type: ignore[index]
542+
assert c.shape == s.shape == (10, 2), ( # type: ignore[index]
543+
f"Expected (10, 2), got chunked={c.shape}, sharded={s.shape}" # type: ignore[union-attr]
544544
)
545545
np.testing.assert_array_equal(c, s)
546546

547547
# Multiple integer axes
548-
c2 = chunked[0, 0, [0, 1, 2]]
549-
s2 = sharded[0, 0, [0, 1, 2]]
550-
assert c2.shape == s2.shape == (3,)
548+
c2 = chunked[0, 0, [0, 1, 2]] # type: ignore[index]
549+
s2 = sharded[0, 0, [0, 1, 2]] # type: ignore[index]
550+
assert c2.shape == s2.shape == (3,) # type: ignore[union-attr]
551551
np.testing.assert_array_equal(c2, s2)
552552

553553
# Slice + integer + slice
554-
c3 = chunked[0:5, 1, 0:3]
555-
s3 = sharded[0:5, 1, 0:3]
556-
assert c3.shape == s3.shape == (5, 3)
554+
c3 = chunked[0:5, 1, 0:3] # type: ignore[index]
555+
s3 = sharded[0:5, 1, 0:3] # type: ignore[index]
556+
assert c3.shape == s3.shape == (5, 3) # type: ignore[union-attr]
557557
np.testing.assert_array_equal(c3, s3)

0 commit comments

Comments
 (0)