File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 7171
7272_VALID_URLS = set (uses_relative + uses_netloc + uses_params )
7373_VALID_URLS .discard ("" )
74- _RFC_3986_PATTERN = re .compile (r"^[A-Za-z][A-Za-z0-9+\-+.]*(::[A-Za-z0-9+\-+.]+)? ://" )
74+ _FSSPEC_URL_PATTERN = re .compile (r"^[A-Za-z][A-Za-z0-9+\-+.]*(::[A-Za-z0-9+\-+.]+)* ://" )
7575
7676BaseBufferT = TypeVar ("BaseBufferT" , bound = BaseBuffer )
7777
@@ -291,7 +291,7 @@ def is_fsspec_url(url: FilePath | BaseBuffer) -> bool:
291291 """
292292 return (
293293 isinstance (url , str )
294- and bool (_RFC_3986_PATTERN .match (url ))
294+ and bool (_FSSPEC_URL_PATTERN .match (url ))
295295 and not url .startswith (("http://" , "https://" ))
296296 )
297297
Original file line number Diff line number Diff line change @@ -505,6 +505,9 @@ def test_is_fsspec_url_chained():
505505 # GH#48978 Support chained fsspec URLs
506506 # See https://filesystem-spec.readthedocs.io/en/latest/features.html#url-chaining.
507507 assert icom .is_fsspec_url ("filecache::s3://pandas/test.csv" )
508+ assert icom .is_fsspec_url ("zip://test.csv::filecache::gcs://bucket/afile.zip" )
509+ assert icom .is_fsspec_url ("filecache::zip://test.csv::gcs://bucket/afile.zip" )
510+ assert icom .is_fsspec_url ("filecache::dask::s3://pandas/test.csv" )
508511 assert not icom .is_fsspec_url ("filecache:s3://pandas/test.csv" )
509512 assert not icom .is_fsspec_url ("filecache:::s3://pandas/test.csv" )
510513 assert not icom .is_fsspec_url ("filecache::://pandas/test.csv" )
You can’t perform that action at this time.
0 commit comments