You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function xr.backends.zarr.extract_zarr_variable_encoding says that it's region argument is optional, but when it is not given, the function fails. It seems the code expects some iterable of the same length as the number of chunks.
What did you expect to happen?
Whatever region=None is supposed to mean for the code should be passed instead of None. I believe, region=[slice(None, None)] * len(variable.chunks) could work.
This doesn't happen with xarray < 2024.10, I believe the issue was introduced with #9559, where a region arg was added to the function with a None default.
To be frank, my actual issue is pangeo-data/rechunker#154, i.e. if the function is considered "private" and the solution is to pass region as I suggested, I will happily do a PR in rechuinker instead.
Environment
INSTALLED VERSIONS
commit: None
python: 3.12.9 | packaged by conda-forge | (main, Feb 14 2025, 08:00:06) [GCC 13.3.0]
python-bits: 64
OS: Linux
OS-release: 6.12.12-200.fc41.x86_64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: fr_CA.UTF-8
LOCALE: ('fr_CA', 'UTF-8')
libhdf5: 1.14.4
libnetcdf: 4.9.2
What happened?
The function
xr.backends.zarr.extract_zarr_variable_encoding
says that it'sregion
argument is optional, but when it is not given, the function fails. It seems the code expects some iterable of the same length as the number of chunks.What did you expect to happen?
Whatever
region=None
is supposed to mean for the code should be passed instead ofNone
. I believe,region=[slice(None, None)] * len(variable.chunks)
could work.Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
This doesn't happen with xarray < 2024.10, I believe the issue was introduced with #9559, where a
region
arg was added to the function with aNone
default.To be frank, my actual issue is pangeo-data/rechunker#154, i.e. if the function is considered "private" and the solution is to pass
region
as I suggested, I will happily do a PR inrechuinker
instead.Environment
INSTALLED VERSIONS
commit: None
python: 3.12.9 | packaged by conda-forge | (main, Feb 14 2025, 08:00:06) [GCC 13.3.0]
python-bits: 64
OS: Linux
OS-release: 6.12.12-200.fc41.x86_64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: fr_CA.UTF-8
LOCALE: ('fr_CA', 'UTF-8')
libhdf5: 1.14.4
libnetcdf: 4.9.2
xarray: 2024.10.0
pandas: 2.2.3
numpy: 2.1.3
scipy: 1.15.2
netCDF4: 1.7.2
pydap: None
h5netcdf: 1.5.0
h5py: 3.12.1
zarr: 2.18.4
cftime: 1.6.4
nc_time_axis: 1.4.1
iris: None
bottleneck: 1.4.2
dask: 2025.2.0
distributed: 2025.2.0
matplotlib: 3.10.0
cartopy: 0.24.0
seaborn: None
numbagg: None
fsspec: 2025.2.0
cupy: None
pint: 0.24.4
sparse: 0.15.5
flox: 0.10.0
numpy_groupies: 0.11.2
setuptools: 75.8.0
pip: 25.0.1
conda: None
pytest: 8.3.4
mypy: 1.15.0
IPython: 8.32.0
sphinx: 8.2.0
The text was updated successfully, but these errors were encountered: