Skip to content

Commit 23ccce2

Browse files
authored
Merge branch 'main' into duplicate-changelog
2 parents 6fd190b + dfd672b commit 23ccce2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changes/3232.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix the type of ``ArrayV2Metadata.codec`` to constrain it to ``numcodecs.abc.Codec | None``.
2+
Previously the type was more permissive, allowing objects that can be parsed into Codecs (e.g., the codec name).
3+
The constructor of ``ArrayV2Metadata`` still allows the permissive input when creating new objects.

src/zarr/core/metadata/v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ArrayV2Metadata(Metadata):
6868
order: MemoryOrder = "C"
6969
filters: tuple[numcodecs.abc.Codec, ...] | None = None
7070
dimension_separator: Literal[".", "/"] = "."
71-
compressor: CompressorLikev2
71+
compressor: numcodecs.abc.Codec | None
7272
attributes: dict[str, JSON] = field(default_factory=dict)
7373
zarr_format: Literal[2] = field(init=False, default=2)
7474

0 commit comments

Comments
 (0)