Skip to content

Commit 59a87b4

Browse files
committed
Ensure reference FS wraps any sync filesystems
1 parent bbe0591 commit 59a87b4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fsspec/implementations/reference.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from fsspec.asyn import AsyncFileSystem
2121
from fsspec.callbacks import DEFAULT_CALLBACK
2222
from fsspec.core import filesystem, open, split_protocol
23+
from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper
2324
from fsspec.utils import isfilelike, merge_offset_ranges, other_paths
2425

2526
logger = logging.getLogger("fsspec.reference")
@@ -757,6 +758,10 @@ def __init__(
757758
self.fss[remote_protocol] = fs
758759

759760
self.fss[None] = fs or filesystem("file") # default one
761+
# Wrap any non-async filesystems to ensure async methods are available below
762+
for k, f in self.fss.items():
763+
if not f.async_impl:
764+
self.fss[k] = AsyncFileSystemWrapper(f)
760765

761766
def _cat_common(self, path, start=None, end=None):
762767
path = self._strip_protocol(path)

0 commit comments

Comments
 (0)