Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataArray.to_zarr doesn't have the new zarr_format parameter #10163

Closed
5 tasks done
Karl-Krauth opened this issue Mar 21, 2025 · 0 comments · Fixed by #10164
Closed
5 tasks done

DataArray.to_zarr doesn't have the new zarr_format parameter #10163

Karl-Krauth opened this issue Mar 21, 2025 · 0 comments · Fixed by #10164
Labels
bug topic-zarr Related to zarr storage library

Comments

@Karl-Krauth
Copy link
Contributor

What happened?

The documentation for Dataset.to_zarr says that zarr_version is deprecated for zarr_format but calling DataArray.to_zarr with zarr_format throws an unexpected keyword exception, while calling it with zarr_version will raise a deprecation warning.

What did you expect to happen?

zarr_format should be a valid parameter

Minimal Complete Verifiable Example

import numpy as np
import xarray as xr

xr.DataArray(np.ones(3)).to_zarr("test", zarr_format=3)

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

TypeError: DataArray.to_zarr() got an unexpected keyword argument 'zarr_format'

Anything else we need to know?

No response

Environment

INSTALLED VERSIONS

commit: None
python: 3.12.9 | packaged by conda-forge | (main, Mar 4 2025, 22:44:42) [Clang 18.1.8 ]
python-bits: 64
OS: Darwin
OS-release: 24.3.0
machine: arm64
processor: arm
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: None
libnetcdf: None

xarray: 0.1.dev5886+gcdebbf5
pandas: 2.2.3
numpy: 2.1.3
scipy: 1.15.2
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
zarr: 3.0.5
cftime: None
nc_time_axis: None
iris: None
bottleneck: None
dask: 2025.2.0
distributed: 2025.2.0
matplotlib: 3.10.1
cartopy: None
seaborn: 0.13.2
numbagg: None
fsspec: 2025.3.0
cupy: None
pint: 0.24.4
sparse: None
flox: None
numpy_groupies: None
setuptools: 75.8.2
pip: 25.0.1
conda: 24.11.3
pytest: None
mypy: None
IPython: 9.0.2
sphinx: 8.2.3

@Karl-Krauth Karl-Krauth added bug needs triage Issue that has not been reviewed by xarray team member labels Mar 21, 2025
@dcherian dcherian added topic-zarr Related to zarr storage library and removed needs triage Issue that has not been reviewed by xarray team member labels Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug topic-zarr Related to zarr storage library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants