Skip to content

Declare zarr and dask as dependencies, require xarray >= 2025.6 - #16

Merged
alexamici merged 1 commit into
mainfrom
declare-zarr-and-dask
Oct 26, 2026
Merged

alexamici merged 1 commit into
mainfrom
declare-zarr-and-dask

Conversation

@nicolamasotti

Copy link
Copy Markdown
Member

What this PR fixes

After pip install xarray-ecmwf, opening any dataset fails:

ds = xr.open_dataset(request, engine="ecmwf")
# ImportError: chunk manager 'dask' is not available. Please make sure 'dask' is installed and importable.

and once dask is installed:

# ImportError: The zarr package is required for working with Zarr stores but could not be imported. ...

The engine needs both, for every client (cdsapi, ecmwf-opendata, polytope):

  • dask: it opens each downloaded file with chunks={}, and chunks the schema sample of each variable;
  • zarr: it caches the schema sample of each variable with to_zarr, and reads it back.

Neither was ever declared, not even in the old conda environment.yml. They were only added to the dev group in d962e26, to make make all-tests work.

With zarr 3, xarray must also be at least 2025.6. Older versions fail on every open:

# xarray 2025.4.0 or older, with zarr 3.1.6
# TypeError: Expected an integer or an iterable of integers. Got None instead.

Changes

  • dask>=2026.8.0 and zarr>=3.1.6 move from the dev group to the package dependencies, with the same minimums.
  • xarray>=2025.6, the first version that works with zarr 3.
  • deptry ignores dask and zarr as unused: the package doesn't import them, xarray does.

Tests

All CI jobs pass locally. A plain install of the built wheel now includes dask and zarr, and opens a dataset.

Notes

@alexamici
alexamici merged commit da1903c into main Oct 26, 2026
10 checks passed
@alexamici
alexamici deleted the declare-zarr-and-dask branch October 30, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants