File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,18 @@ def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem:
4545 if fs .async_impl and fs .asynchronous :
4646 return fs
4747 if fs .async_impl :
48- fs_dict = fs .to_dict ()
49- fs_dict ["asynchronous" ] = True
50- return AbstractFileSystem .from_dict (fs_dict )
48+ try :
49+ fs_dict = fs .to_dict ()
50+ fs_dict ["asynchronous" ] = True
51+ return AbstractFileSystem .from_dict (fs_dict )
52+ except AttributeError :
53+ # Older fsspec specification used to_json rather than to_dict
54+ import json
55+
56+ fs_dict = json .loads (fs .to_json ())
57+ fs_dict ["asynchronous" ] = True
58+ return AbstractFileSystem .from_json (json .dumps (fs_dict ))
59+
5160 from fsspec .implementations .local import LocalFileSystem
5261
5362 if type (fs ) is LocalFileSystem and not fs .auto_mkdir :
You can’t perform that action at this time.
0 commit comments