File tree 2 files changed +5
-2
lines changed 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 71
71
72
72
_VALID_URLS = set (uses_relative + uses_netloc + uses_params )
73
73
_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+\-+.]+)* ://" )
75
75
76
76
BaseBufferT = TypeVar ("BaseBufferT" , bound = BaseBuffer )
77
77
@@ -291,7 +291,7 @@ def is_fsspec_url(url: FilePath | BaseBuffer) -> bool:
291
291
"""
292
292
return (
293
293
isinstance (url , str )
294
- and bool (_RFC_3986_PATTERN .match (url ))
294
+ and bool (_FSSPEC_URL_PATTERN .match (url ))
295
295
and not url .startswith (("http://" , "https://" ))
296
296
)
297
297
Original file line number Diff line number Diff line change @@ -505,6 +505,9 @@ def test_is_fsspec_url_chained():
505
505
# GH#48978 Support chained fsspec URLs
506
506
# See https://filesystem-spec.readthedocs.io/en/latest/features.html#url-chaining.
507
507
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" )
508
511
assert not icom .is_fsspec_url ("filecache:s3://pandas/test.csv" )
509
512
assert not icom .is_fsspec_url ("filecache:::s3://pandas/test.csv" )
510
513
assert not icom .is_fsspec_url ("filecache::://pandas/test.csv" )
You can’t perform that action at this time.
0 commit comments