Skip to content

Commit d38c186

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 62551c7 commit d38c186

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
@@ -138,10 +138,6 @@ def __init__(
138138
category=ZarrUserWarning,
139139
stacklevel=2,
140140
)
141-
if "://" in path and not path.startswith("http"):
142-
# `not path.startswith("http")` is a special case for the http filesystem (¯\_(ツ)_/¯)
143-
scheme, _ = path.split("://", maxsplit=1)
144-
raise ValueError(f"path argument to FsspecStore must not include scheme ({scheme}://)")
145141

146142
@classmethod
147143
def from_upath(
@@ -246,12 +242,6 @@ def from_url(
246242
if not fs.async_impl:
247243
fs = _make_async(fs)
248244

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

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

0 commit comments

Comments
 (0)