Skip to content

Commit 38a841c

Browse files
committed
Wrap sync fs for xarray.to_zarr
1 parent f360fc6 commit 38a841c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/zarr/storage/fsspec.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import warnings
44
from typing import TYPE_CHECKING, Any
55

6+
from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper
7+
68
from zarr.abc.store import ByteRangeRequest, Store
79
from zarr.storage.common import _dereference_path
810

@@ -166,6 +168,8 @@ def from_url(
166168
opts = {"asynchronous": True, **opts}
167169

168170
fs, path = url_to_fs(url, **opts)
171+
if not fs.async_impl:
172+
fs = AsyncFileSystemWrapper(fs)
169173

170174
# fsspec is not consistent about removing the scheme from the path, so check and strip it here
171175
# https://github.com/fsspec/filesystem_spec/issues/1722

0 commit comments

Comments
 (0)