Skip to content

Commit 679e7d8

Browse files
d-v-bclaude
andauthored
Fix test collection and mypy under zarr 3.2.x (#171)
* Fix test collection and mypy under zarr 3.2.x Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Add changelog fragment for #171 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 3781ce1 commit 679e7d8

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

changes/171.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed test-suite collection (`Struct`/`Structured` dtype) and mypy type-checking under zarr-python 3.2.x.

tests/test_pydantic_zarr/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class DTypeExample:
7373
Int32,
7474
NullTerminatedBytes,
7575
RawBytes,
76+
Structured,
7677
TimeDelta64,
7778
data_type_registry,
7879
)
@@ -84,7 +85,7 @@ class DTypeExample:
8485
dt = dtype_cls(unit="s", scale_factor=10)
8586
elif dtype_cls in (FixedLengthUTF32, RawBytes, NullTerminatedBytes):
8687
dt = dtype_cls(length=10)
87-
elif dtype_cls._zarr_v3_name in ("struct", "structured"):
88+
elif issubclass(dtype_cls, Structured):
8889
dt = dtype_cls(fields=[("a", Int32()), ("b", Float16())])
8990
else:
9091
dt = dtype_cls()

0 commit comments

Comments
 (0)