Skip to content

Commit

Permalink
allow genericFS to work on URLs with embedded options (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant authored Aug 3, 2023
1 parent d9c781a commit 61cdf52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fsspec/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from .asyn import AsyncFileSystem
from .callbacks import _DEFAULT_CALLBACK
from .core import filesystem, get_filesystem_class, split_protocol
from .core import filesystem, get_filesystem_class, split_protocol, url_to_fs

_generic_fs = {}
logger = logging.getLogger("fsspec.generic")
Expand All @@ -29,7 +29,8 @@ def _resolve_fs(url, method=None, protocol=None, storage_options=None):
cls = get_filesystem_class(protocol)
return cls.current()
if method == "options":
return filesystem(protocol, **storage_options.get(protocol, {}))
fs, _ = url_to_fs(url, **storage_options.get(protocol, {}))
return fs
raise ValueError(f"Unknown FS resolution method: {method}")


Expand Down

0 comments on commit 61cdf52

Please sign in to comment.