Skip to content

Commit 6ea661a

Browse files
committed
dtype updates
1 parent 328d178 commit 6ea661a

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

ci/install-upstream-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ python -m pip install \
5353
git+https://github.com/dask/dask \
5454
git+https://github.com/dask/dask-expr \
5555
git+https://github.com/dask/distributed \
56-
git+https://github.com/d-v-b/zarr-python.git@feat/fixed-length-strings \
56+
git+https://github.com/zarr-developers/zarr-python.git@main \
5757
git+https://github.com/Unidata/cftime \
5858
git+https://github.com/pypa/packaging \
5959
git+https://github.com/hgrecco/pint \

xarray/tests/test_backends.py

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,6 @@ def create_store(self):
365365
def roundtrip(
366366
self, data, save_kwargs=None, open_kwargs=None, allow_cleanup_failure=False
367367
):
368-
print(save_kwargs)
369-
print(open_kwargs)
370368
if save_kwargs is None:
371369
save_kwargs = {}
372370
if open_kwargs is None:
@@ -912,9 +910,6 @@ def test_roundtrip_bytes_with_fill_value(self) -> None:
912910
encoding = {"_FillValue": b"X", "dtype": "S1"}
913911
original = Dataset({"x": ("t", values, {}, encoding)})
914912
expected = original.copy(deep=True)
915-
zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3
916-
print(zarr_format_3)
917-
print(self.version_kwargs)
918913
with self.roundtrip(original) as actual:
919914
assert_identical(expected, actual)
920915

@@ -2333,7 +2328,6 @@ def create_store(self, cache_members: bool = False):
23332328
)
23342329

23352330
def save(self, dataset, store_target, **kwargs): # type: ignore[override]
2336-
print("ver kwargs", self.version_kwargs)
23372331
return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs)
23382332

23392333
@contextlib.contextmanager
@@ -2385,7 +2379,8 @@ def test_read_non_consolidated_warning(self) -> None:
23852379

23862380
def test_non_existent_store(self) -> None:
23872381
with pytest.raises(
2388-
FileNotFoundError, match="(No such file or directory|Unable to find group)"
2382+
FileNotFoundError,
2383+
match="(No such file or directory|Unable to find group|No group found in store)",
23892384
):
23902385
xr.open_zarr(f"{uuid.uuid4()}")
23912386

@@ -2467,6 +2462,7 @@ def test_manual_chunk(self) -> None:
24672462
assert_identical(actual.load(), auto.load())
24682463

24692464
@requires_dask
2465+
@pytest.mark.filterwarnings("ignore:.*does not have a Zarr V3 specification.*")
24702466
def test_warning_on_bad_chunks(self) -> None:
24712467
original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3})
24722468

@@ -2875,7 +2871,6 @@ def test_append_with_existing_encoding_raises(self) -> None:
28752871

28762872
@pytest.mark.parametrize("dtype", ["U", "S"])
28772873
def test_append_string_length_mismatch_raises(self, dtype) -> None:
2878-
skip_if_zarr_format_3("This actually works fine with Zarr format 3")
28792874
ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype)
28802875
with self.create_zarr_target() as store_target:
28812876
ds.to_zarr(store_target, mode="w", **self.version_kwargs)
@@ -2884,18 +2879,6 @@ def test_append_string_length_mismatch_raises(self, dtype) -> None:
28842879
store_target, append_dim="time", **self.version_kwargs
28852880
)
28862881

2887-
@pytest.mark.parametrize("dtype", ["U", "S"])
2888-
def test_append_string_length_mismatch_works(self, dtype) -> None:
2889-
skip_if_zarr_format_2("This doesn't work with Zarr format 2")
2890-
# ...but it probably would if we used object dtype
2891-
ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype)
2892-
expected = xr.concat([ds, ds_to_append], dim="time")
2893-
with self.create_zarr_target() as store_target:
2894-
ds.to_zarr(store_target, mode="w", **self.version_kwargs)
2895-
ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs)
2896-
actual = xr.open_dataset(store_target, engine="zarr")
2897-
xr.testing.assert_identical(expected, actual)
2898-
28992882
def test_check_encoding_is_consistent_after_append(self) -> None:
29002883
ds, ds_to_append, _ = create_append_test_data()
29012884

@@ -2977,6 +2960,11 @@ def test_append_with_append_dim_no_overwrite(self) -> None:
29772960
original2["lon"] = lon
29782961
assert_identical(original2, actual)
29792962

2963+
def test_minimal_round(self) -> None:
2964+
ds = create_test_data()
2965+
with self.roundtrip(ds) as ds_reload:
2966+
assert_identical(ds, ds_reload)
2967+
29802968
@requires_dask
29812969
def test_to_zarr_compute_false_roundtrip(self) -> None:
29822970
from dask.delayed import Delayed
@@ -3732,10 +3720,6 @@ def roundtrip_dir(
37323720
if open_kwargs is None:
37333721
open_kwargs = {}
37343722

3735-
print("here?")
3736-
print(save_kwargs)
3737-
print(self.version_kwargs)
3738-
print(open_kwargs)
37393723
data.to_zarr(store, **save_kwargs, **self.version_kwargs)
37403724
with xr.open_dataset(
37413725
store, engine="zarr", **open_kwargs, **self.version_kwargs

0 commit comments

Comments
 (0)