diff --git a/src/zarr/storage/fsspec.py b/src/zarr/storage/fsspec.py index c9edd8f8ac..b588c763a9 100644 --- a/src/zarr/storage/fsspec.py +++ b/src/zarr/storage/fsspec.py @@ -3,6 +3,8 @@ import warnings from typing import TYPE_CHECKING, Any +from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper + from zarr.abc.store import ByteRangeRequest, Store from zarr.storage.common import _dereference_path @@ -166,6 +168,8 @@ def from_url( opts = {"asynchronous": True, **opts} fs, path = url_to_fs(url, **opts) + if not fs.async_impl: + fs = AsyncFileSystemWrapper(fs) # fsspec is not consistent about removing the scheme from the path, so check and strip it here # https://github.com/fsspec/filesystem_spec/issues/1722