Skip to content

Commit a325217

Browse files
committed
fsspec path handling
Proposed as fix for #3201. Some filesystems need the scheme as part of the path, while others don't. FsspecStore.from_url() throws an exception if the scheme is left in the path, for any filesystem except http and https. However, the swift fs also needs the scheme in the path. This commit removes the exception, rather than adding more special cases.
1 parent 22b177c commit a325217

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/zarr/storage/_fsspec.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ def __init__(
139139
f"fs ({fs}) was not created with `asynchronous=True`, this may lead to surprising behavior",
140140
stacklevel=2,
141141
)
142-
if "://" in path and not path.startswith("http"):
143-
# `not path.startswith("http")` is a special case for the http filesystem (¯\_(ツ)_/¯)
144-
scheme, _ = path.split("://", maxsplit=1)
145-
raise ValueError(f"path argument to FsspecStore must not include scheme ({scheme}://)")
146142

147143
@classmethod
148144
def from_upath(
@@ -247,12 +243,6 @@ def from_url(
247243
if not fs.async_impl:
248244
fs = _make_async(fs)
249245

250-
# fsspec is not consistent about removing the scheme from the path, so check and strip it here
251-
# https://github.com/fsspec/filesystem_spec/issues/1722
252-
if "://" in path and not path.startswith("http"):
253-
# `not path.startswith("http")` is a special case for the http filesystem (¯\_(ツ)_/¯)
254-
path = fs._strip_protocol(path)
255-
256246
return cls(fs=fs, path=path, read_only=read_only, allowed_exceptions=allowed_exceptions)
257247

258248
def with_read_only(self, read_only: bool = False) -> FsspecStore:

0 commit comments

Comments
 (0)