Skip to content

Commit 18bc6f7

Browse files
committed
Wrap sync fs for xarray.to_zarr
1 parent d005ff7 commit 18bc6f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/zarr/storage/remote.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ def from_url(
166166
opts = {"asynchronous": True, **opts}
167167

168168
fs, path = url_to_fs(url, **opts)
169+
if not fs.async_impl:
170+
from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper
171+
fs = AsyncFileSystemWrapper(fs)
169172

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

0 commit comments

Comments
 (0)