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

Broken support for write_empty_chunks with Zarr v3 #10056

Open
1 of 5 tasks
sotosoul opened this issue Feb 17, 2025 · 1 comment
Open
1 of 5 tasks

Broken support for write_empty_chunks with Zarr v3 #10056

sotosoul opened this issue Feb 17, 2025 · 1 comment
Labels
bug topic-zarr Related to zarr storage library

Comments

@sotosoul
Copy link

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
@sotosoul sotosoul added bug needs triage Issue that has not been reviewed by xarray team member labels Feb 17, 2025
Copy link

welcome bot commented Feb 17, 2025

Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!

@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 Feb 17, 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

No branches or pull requests

2 participants