File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
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+\-+.]*://" )
74
+ _RFC_3986_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
Original file line number Diff line number Diff line change @@ -1753,6 +1753,7 @@ def test_read_timezone_information(self):
1753
1753
[
1754
1754
"s3://example-fsspec/" ,
1755
1755
"gcs://another-fsspec/file.json" ,
1756
+ "filecache::s3://yet-another-fsspec/file.json" ,
1756
1757
"https://example-site.com/data" ,
1757
1758
"some-protocol://data.txt" ,
1758
1759
],
Original file line number Diff line number Diff line change @@ -501,6 +501,15 @@ def test_is_fsspec_url():
501
501
assert icom .is_fsspec_url ("RFC-3986+compliant.spec://something" )
502
502
503
503
504
+ def test_is_fsspec_url_chained ():
505
+ # GH#48978 Support chained fsspec URLs
506
+ # See https://filesystem-spec.readthedocs.io/en/latest/features.html#url-chaining.
507
+ assert icom .is_fsspec_url ("filecache::s3://pandas/test.csv" )
508
+ assert not icom .is_fsspec_url ("filecache:s3://pandas/test.csv" )
509
+ assert not icom .is_fsspec_url ("filecache:::s3://pandas/test.csv" )
510
+ assert not icom .is_fsspec_url ("filecache::://pandas/test.csv" )
511
+
512
+
504
513
@pytest .mark .parametrize ("encoding" , [None , "utf-8" ])
505
514
@pytest .mark .parametrize ("format" , ["csv" , "json" ])
506
515
def test_codecs_encoding (encoding , format ):
You can’t perform that action at this time.
0 commit comments