diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index c5afed521c..7945fba467 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -138,10 +138,6 @@ def __init__( category=ZarrUserWarning, stacklevel=2, ) - if "://" in path and not path.startswith("http"): - # `not path.startswith("http")` is a special case for the http filesystem (¯\_(ツ)_/¯) - scheme, _ = path.split("://", maxsplit=1) - raise ValueError(f"path argument to FsspecStore must not include scheme ({scheme}://)") @classmethod def from_upath( @@ -246,12 +242,6 @@ def from_url( if not fs.async_impl: fs = _make_async(fs) - # fsspec is not consistent about removing the scheme from the path, so check and strip it here - # https://github.com/fsspec/filesystem_spec/issues/1722 - if "://" in path and not path.startswith("http"): - # `not path.startswith("http")` is a special case for the http filesystem (¯\_(ツ)_/¯) - path = fs._strip_protocol(path) - return cls(fs=fs, path=path, read_only=read_only, allowed_exceptions=allowed_exceptions) def with_read_only(self, read_only: bool = False) -> FsspecStore: diff --git a/tests/test_store/test_fsspec.py b/tests/test_store/test_fsspec.py index e970c674d4..1e3ed26568 100644 --- a/tests/test_store/test_fsspec.py +++ b/tests/test_store/test_fsspec.py @@ -238,14 +238,6 @@ def test_from_upath(self) -> None: assert result.fs.asynchronous assert result.path == f"{test_bucket_name}/foo/bar" - def test_init_raises_if_path_has_scheme(self, store_kwargs: dict[str, Any]) -> None: - # regression test for https://github.com/zarr-developers/zarr-python/issues/2342 - store_kwargs["path"] = "s3://" + store_kwargs["path"] - with pytest.raises( - ValueError, match="path argument to FsspecStore must not include scheme .*" - ): - self.store_cls(**store_kwargs) - def test_init_warns_if_fs_asynchronous_is_false(self) -> None: try: from fsspec import url_to_fs