Open
Description
What happened?
The to_zarr()
method accepts a keyword argument write_empty_chunks
but the Zarr 3 backend no longer supports it. Instead, it can accept config={'write_empty_chunks': False}
but to_zarr
does not.
xarray 2025.1.2, zarr 3.0.3
What did you expect to happen?
It would write the data in Zarr skipping the empty chunks..
Minimal Complete Verifiable Example
ds = xr.Dataset(...)
ds.to_zarr(write_empty_chunks=False, ...) # Raises: TypeError: Group.create_array() got an unexpected keyword argument 'write_empty_chunks'
ds.to_zarr(config={'write_empty_chunks': False}, ...) # Unexpected kwarg 'config'
MVCE confirmation
- Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
- Complete example — the example is self-contained, including all data and the text of any traceback.
- Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
- New issue — a search of GitHub Issues suggests this is not a duplicate.
- Recent environment — the issue occurs with the latest version of xarray and its dependencies.
Relevant log output
Anything else we need to know?
May I also suggest that you add a zarr_backend_kwargs
argument that gets passed to the Zarr backend?
Environment
xarray=2025.1.2, zarr=3.0.3