Skip to content

Commit 48be376

Browse files
authored
Fix broken Zarr test (#10109)
Zarr's implementation of `attrs.__delitem__` is broken.
1 parent 852ad11 commit 48be376

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

xarray/tests/test_backends.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,12 +2628,10 @@ def test_hidden_zarr_keys(self) -> None:
26282628
for var in expected.variables.keys():
26292629
assert self.DIMENSION_KEY not in expected[var].attrs
26302630

2631-
if has_zarr_v3:
2632-
# temporary workaround for https://github.com/zarr-developers/zarr-python/issues/2338
2633-
zarr_group.store._is_open = True
2634-
26352631
# put it back and try removing from a variable
2636-
del zarr_group["var2"].attrs[self.DIMENSION_KEY]
2632+
attrs = dict(zarr_group["var2"].attrs)
2633+
del attrs[self.DIMENSION_KEY]
2634+
zarr_group["var2"].attrs.put(attrs)
26372635

26382636
with pytest.raises(KeyError):
26392637
with xr.decode_cf(store):

0 commit comments

Comments
 (0)