Skip to content

[do not merge] test new dtypes in zarr-python #10332

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/install-upstream-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ python -m pip install \
git+https://github.com/dask/dask \
git+https://github.com/dask/dask-expr \
git+https://github.com/dask/distributed \
git+https://github.com/zarr-developers/zarr-python \
git+https://github.com/d-v-b/zarr-python.git@feat/fixed-length-strings \
git+https://github.com/Unidata/cftime \
git+https://github.com/pypa/packaging \
git+https://github.com/hgrecco/pint \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ io = [
"h5netcdf",
"scipy",
'pydap; python_version<"3.10"',
"zarr",
"zarr @ git+https://github.com/d-v-b/zarr-python.git@feat/fixed-length-strings",
"fsspec",
"cftime",
"pooch",
Expand Down
10 changes: 8 additions & 2 deletions xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from xarray.core.variable import Variable
from xarray.namedarray.parallelcompat import guess_chunkmanager
from xarray.namedarray.pycompat import integer_types
from xarray.namedarray.utils import module_available

if TYPE_CHECKING:
from xarray.backends.common import AbstractDataStore
Expand Down Expand Up @@ -106,7 +105,14 @@ def _choose_default_mode(


def _zarr_v3() -> bool:
return module_available("zarr", minversion="3")
# don't use the module_available function because it doesn't report zarr v3 correctly.
try:
import zarr
from packaging.version import Version

return Version(zarr.__version__).major == 3
except ImportError:
return False


# need some special secret attributes to tell us the dimensions
Expand Down
1 change: 0 additions & 1 deletion xarray/namedarray/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def module_available(module: str, minversion: str | None = None) -> bool:
"""
if importlib.util.find_spec(module) is None:
return False

if minversion is not None:
version = importlib.metadata.version(module)

Expand Down
Loading