Skip to content

Commit 4bc9508

Browse files
committed
dtype updates
1 parent 7bdc7c7 commit 4bc9508

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
@@ -363,8 +363,6 @@ def create_store(self):
363363
def roundtrip(
364364
self, data, save_kwargs=None, open_kwargs=None, allow_cleanup_failure=False
365365
):
366-
print(save_kwargs)
367-
print(open_kwargs)
368366
if save_kwargs is None:
369367
save_kwargs = {}
370368
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

@@ -2352,7 +2347,6 @@ def create_store(self, cache_members: bool = False):
23522347
)
23532348

23542349
def save(self, dataset, store_target, **kwargs): # type: ignore[override]
2355-
print("ver kwargs", self.version_kwargs)
23562350
return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs)
23572351

23582352
@contextlib.contextmanager
@@ -2404,7 +2398,8 @@ def test_read_non_consolidated_warning(self) -> None:
24042398

24052399
def test_non_existent_store(self) -> None:
24062400
with pytest.raises(
2407-
FileNotFoundError, match="(No such file or directory|Unable to find group)"
2401+
FileNotFoundError,
2402+
match="(No such file or directory|Unable to find group|No group found in store)",
24082403
):
24092404
xr.open_zarr(f"{uuid.uuid4()}")
24102405

@@ -2486,6 +2481,7 @@ def test_manual_chunk(self) -> None:
24862481
assert_identical(actual.load(), auto.load())
24872482

24882483
@requires_dask
2484+
@pytest.mark.filterwarnings("ignore:.*does not have a Zarr V3 specification.*")
24892485
def test_warning_on_bad_chunks(self) -> None:
24902486
original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3})
24912487

@@ -2894,7 +2890,6 @@ def test_append_with_existing_encoding_raises(self) -> None:
28942890

28952891
@pytest.mark.parametrize("dtype", ["U", "S"])
28962892
def test_append_string_length_mismatch_raises(self, dtype) -> None:
2897-
skip_if_zarr_format_3("This actually works fine with Zarr format 3")
28982893
ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype)
28992894
with self.create_zarr_target() as store_target:
29002895
ds.to_zarr(store_target, mode="w", **self.version_kwargs)
@@ -2903,18 +2898,6 @@ def test_append_string_length_mismatch_raises(self, dtype) -> None:
29032898
store_target, append_dim="time", **self.version_kwargs
29042899
)
29052900

2906-
@pytest.mark.parametrize("dtype", ["U", "S"])
2907-
def test_append_string_length_mismatch_works(self, dtype) -> None:
2908-
skip_if_zarr_format_2("This doesn't work with Zarr format 2")
2909-
# ...but it probably would if we used object dtype
2910-
ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype)
2911-
expected = xr.concat([ds, ds_to_append], dim="time")
2912-
with self.create_zarr_target() as store_target:
2913-
ds.to_zarr(store_target, mode="w", **self.version_kwargs)
2914-
ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs)
2915-
actual = xr.open_dataset(store_target, engine="zarr")
2916-
xr.testing.assert_identical(expected, actual)
2917-
29182901
def test_check_encoding_is_consistent_after_append(self) -> None:
29192902
ds, ds_to_append, _ = create_append_test_data()
29202903

@@ -2996,6 +2979,11 @@ def test_append_with_append_dim_no_overwrite(self) -> None:
29962979
original2["lon"] = lon
29972980
assert_identical(original2, actual)
29982981

2982+
def test_minimal_round(self) -> None:
2983+
ds = create_test_data()
2984+
with self.roundtrip(ds) as ds_reload:
2985+
assert_identical(ds, ds_reload)
2986+
29992987
@requires_dask
30002988
def test_to_zarr_compute_false_roundtrip(self) -> None:
30012989
from dask.delayed import Delayed
@@ -3784,10 +3772,6 @@ def roundtrip_dir(
37843772
if open_kwargs is None:
37853773
open_kwargs = {}
37863774

3787-
print("here?")
3788-
print(save_kwargs)
3789-
print(self.version_kwargs)
3790-
print(open_kwargs)
37913775
data.to_zarr(store, **save_kwargs, **self.version_kwargs)
37923776
with xr.open_dataset(
37933777
store, engine="zarr", **open_kwargs, **self.version_kwargs

0 commit comments

Comments
 (0)