Skip to content

Commit 031b0b4

Browse files
committed
dtype updates
1 parent 90de115 commit 031b0b4

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-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: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ def create_store(self):
369369
def roundtrip(
370370
self, data, save_kwargs=None, open_kwargs=None, allow_cleanup_failure=False
371371
):
372-
print(save_kwargs)
373-
print(open_kwargs)
374372
if save_kwargs is None:
375373
save_kwargs = {}
376374
if open_kwargs is None:
@@ -928,9 +926,6 @@ def test_roundtrip_bytes_with_fill_value(self) -> None:
928926
encoding = {"_FillValue": b"X", "dtype": "S1"}
929927
original = Dataset({"x": ("t", values, {}, encoding)})
930928
expected = original.copy(deep=True)
931-
zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3
932-
print(zarr_format_3)
933-
print(self.version_kwargs)
934929
with self.roundtrip(original) as actual:
935930
assert_identical(expected, actual)
936931

@@ -2368,7 +2363,6 @@ def create_store(self, cache_members: bool = False):
23682363
)
23692364

23702365
def save(self, dataset, store_target, **kwargs): # type: ignore[override]
2371-
print("ver kwargs", self.version_kwargs)
23722366
return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs)
23732367

23742368
@contextlib.contextmanager
@@ -2422,7 +2416,7 @@ def test_read_non_consolidated_warning(self) -> None:
24222416
def test_non_existent_store(self) -> None:
24232417
with pytest.raises(
24242418
FileNotFoundError,
2425-
match="(No such file or directory|Unable to find group|No group found)",
2419+
match="(No such file or directory|Unable to find group|No group found in store)",
24262420
):
24272421
xr.open_zarr(f"{uuid.uuid4()}")
24282422

@@ -2504,6 +2498,7 @@ def test_manual_chunk(self) -> None:
25042498
assert_identical(actual.load(), auto.load())
25052499

25062500
@requires_dask
2501+
@pytest.mark.filterwarnings("ignore:.*does not have a Zarr V3 specification.*")
25072502
def test_warning_on_bad_chunks(self) -> None:
25082503
original = create_test_data().chunk({"dim1": 4, "dim2": 3, "dim3": 3})
25092504

@@ -2912,7 +2907,6 @@ def test_append_with_existing_encoding_raises(self) -> None:
29122907

29132908
@pytest.mark.parametrize("dtype", ["U", "S"])
29142909
def test_append_string_length_mismatch_raises(self, dtype) -> None:
2915-
skip_if_zarr_format_3("This actually works fine with Zarr format 3")
29162910
ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype)
29172911
with self.create_zarr_target() as store_target:
29182912
ds.to_zarr(store_target, mode="w", **self.version_kwargs)
@@ -2921,18 +2915,6 @@ def test_append_string_length_mismatch_raises(self, dtype) -> None:
29212915
store_target, append_dim="time", **self.version_kwargs
29222916
)
29232917

2924-
@pytest.mark.parametrize("dtype", ["U", "S"])
2925-
def test_append_string_length_mismatch_works(self, dtype) -> None:
2926-
skip_if_zarr_format_2("This doesn't work with Zarr format 2")
2927-
# ...but it probably would if we used object dtype
2928-
ds, ds_to_append = create_append_string_length_mismatch_test_data(dtype)
2929-
expected = xr.concat([ds, ds_to_append], dim="time")
2930-
with self.create_zarr_target() as store_target:
2931-
ds.to_zarr(store_target, mode="w", **self.version_kwargs)
2932-
ds_to_append.to_zarr(store_target, append_dim="time", **self.version_kwargs)
2933-
actual = xr.open_dataset(store_target, engine="zarr")
2934-
xr.testing.assert_identical(expected, actual)
2935-
29362918
def test_check_encoding_is_consistent_after_append(self) -> None:
29372919
ds, ds_to_append, _ = create_append_test_data()
29382920

@@ -3014,6 +2996,11 @@ def test_append_with_append_dim_no_overwrite(self) -> None:
30142996
original2["lon"] = lon
30152997
assert_identical(original2, actual)
30162998

2999+
def test_minimal_round(self) -> None:
3000+
ds = create_test_data()
3001+
with self.roundtrip(ds) as ds_reload:
3002+
assert_identical(ds, ds_reload)
3003+
30173004
@requires_dask
30183005
def test_to_zarr_compute_false_roundtrip(self) -> None:
30193006
from dask.delayed import Delayed
@@ -3838,10 +3825,6 @@ def roundtrip_dir(
38383825
if open_kwargs is None:
38393826
open_kwargs = {}
38403827

3841-
print("here?")
3842-
print(save_kwargs)
3843-
print(self.version_kwargs)
3844-
print(open_kwargs)
38453828
data.to_zarr(store, **save_kwargs, **self.version_kwargs)
38463829
with xr.open_dataset(
38473830
store, engine="zarr", **open_kwargs, **self.version_kwargs

0 commit comments

Comments
 (0)