Skip to content

Commit be61a82

Browse files
authored
zarr deprecation: enums becoming string literals (#11438)
* zarr changed from enums to string literals * temporarily remove numcodecs from the nightly deps * explanatory comment [test-upstream] * change the comment for the numcodecs workaround
1 parent 1e1973b commit be61a82

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎pixi.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pyarrow = { version = "*", index = "https://pypi.anaconda.org/scientific-python-
157157
dask = { git = "https://github.com/dask/dask" }
158158
distributed = { git = "https://github.com/dask/distributed" }
159159
zarr = { git = "https://github.com/zarr-developers/zarr-python" }
160-
numcodecs = { git = "https://github.com/zarr-developers/numcodecs" }
160+
# numcodecs = { git = "https://github.com/zarr-developers/numcodecs" } #? compilation fails currently, see #11437
161161
cftime = { git = "https://github.com/Unidata/cftime" }
162162
# packaging = { git = "https://github.com/pypa/packaging"} #? Pixi warns if this is enabled
163163
pint = { git = "https://github.com/hgrecco/pint" }

‎xarray/tests/test_backends_datatree.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,11 @@ def test_zarr_encoding(self, tmpdir, simple_datatree, zarr_format) -> None:
716716
# zarr v3 BloscCodec auto-tunes typesize and shuffle on write,
717717
# so we only check the attributes we explicitly set
718718
rt_codec = roundtrip_dt["/set2/a"].encoding[compressor_key][0]
719-
assert rt_codec.cname.value == "zstd"
719+
# DEPR: backwards compatibility with zarr <= 3.2.1
720+
# This will become a string in the future.
721+
# Once we can drop zarr <= 3.2.1, the assertion can become
722+
# assert rt_codec.cname == "zstd"
723+
assert getattr(rt_codec.cname, "value", rt_codec.cname) == "zstd"
720724
assert rt_codec.clevel == 3
721725
else:
722726
assert (

0 commit comments

Comments
 (0)