Skip to content

Commit

Permalink
Wrap sync fs for xarray.to_zarr
Browse files Browse the repository at this point in the history
  • Loading branch information
moradology committed Dec 4, 2024
1 parent d005ff7 commit 18bc6f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/zarr/storage/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ def from_url(
opts = {"asynchronous": True, **opts}

fs, path = url_to_fs(url, **opts)
if not fs.async_impl:
from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper
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
Expand Down

0 comments on commit 18bc6f7

Please sign in to comment.