Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ New Features
Breaking Changes
~~~~~~~~~~~~~~~~

- Remove special mapping of ``"auto"`` to ``{}`` in ``open_zarr``. This matches the behavior of ``open_dataset(..., engine="zarr")``
and means that by default the chunks might be a multiple of the the on-disk chunks. (:issue:`11002` :pull:`11010`).
By `Julia Signell <https://github.com/jsignell>`_.

Deprecations
~~~~~~~~~~~~
Expand Down
1 change: 0 additions & 1 deletion xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,6 @@ def open_zarr(
chunked_array_type
) # attempt to import that parallel backend

chunks = {}
except (ValueError, ImportError):
chunks = None

Expand Down
12 changes: 12 additions & 0 deletions xarray/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -3637,6 +3637,18 @@ def test_chunk_encoding_with_larger_dask_chunks(self) -> None:
) as ds1:
assert_equal(ds1, original)

@requires_dask
def test_chunk_auto_with_small_dask_chunks(self) -> None:
original = Dataset({"u": (("x",), np.zeros(10))}).chunk({"x": 2})
with self.create_zarr_target() as store:
original.to_zarr(store, **self.version_kwargs)
with xr.open_zarr(store, chunks={}, **self.version_kwargs) as native:
assert native.chunks == {"x": (2, 2, 2, 2, 2)}
with xr.open_zarr(store, **self.version_kwargs) as actual:
assert_identical(actual, original)
assert actual.chunks == {"x": (10,)}
assert actual.chunks != native.chunks

@requires_cftime
def test_open_zarr_use_cftime(self) -> None:
ds = create_test_data()
Expand Down
Loading