Skip to content

mfdataset using glob syntax from S3 not working since zarr v3 #10108

Open
@joaomacalos

Description

@joaomacalos

What happened?

Hello,
Since the package update to implement the new zarr specification, the glob syntax for loading S3 files is not working anymore.

For example, the following code:

import xarray as xr

xr.open_mfdataset("s3://mybucket/myzarr/*.zarr", engine="zarr")

no longer works. The error is the following:

TypeError: Unsupported type for store_like: 'FSMap'

Reading the latest documentation, I see that you now suggest the explicit utilization of a mutablemapping instance. In my case, I would have to do something like this:

from s3fs import S3FileSystem
import xarray as xr

s3 = S3FileSystem()
xr.open_mfdataset(["s3://" + file for file in s3.glob("s3://mybucket/myzarr/*.zarr")], engine="zarr")

All of a sudden the code becomes twice as long, I have to import s3fs explicitly and use a list-comprehension to append the "s3://" prefix to the file names.

Are you planning to re-implement the old behavior? There is something that I'm missing here?

What did you expect to happen?

I would expect the previous syntax to remain working.

Minimal Complete Verifiable Example

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?

No response

Environment

INSTALLED VERSIONS ------------------ commit: None python: 3.11.11 | packaged by conda-forge | (main, Mar 3 2025, 20:43:55) [GCC 13.3.0] python-bits: 64 OS: Linux OS-release: 6.8.0-1021-aws machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: C.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.14.4 libnetcdf: 4.9.2

xarray: 2025.1.2
pandas: 2.2.3
numpy: 2.2.3
scipy: 1.15.2
netCDF4: 1.7.2
pydap: 3.5.3
h5netcdf: None
h5py: 3.12.1
zarr: 3.0.4
cftime: 1.6.4
nc_time_axis: None
iris: None
bottleneck: None
dask: 2025.2.0
distributed: 2025.2.0
matplotlib: 3.10.1
cartopy: None
seaborn: None
numbagg: None
fsspec: 2025.2.0
cupy: None
pint: None
sparse: None
flox: 0.10.0
numpy_groupies: 0.11.2
setuptools: 75.8.2
pip: 25.0.1
conda: None
pytest: None
mypy: None
IPython: 9.0.1
sphinx: None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions