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 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+\-+.]*://" )
74+ _RFC_3986_PATTERN = re .compile (r"^[A-Za-z][A-Za-z0-9+\-+.]*(::[A-Za-z0-9+\-+.]+)? ://" )
7575
7676BaseBufferT = TypeVar ("BaseBufferT" , bound = BaseBuffer )
7777
Original file line number Diff line number Diff line change @@ -1753,6 +1753,7 @@ def test_read_timezone_information(self):
17531753 [
17541754 "s3://example-fsspec/" ,
17551755 "gcs://another-fsspec/file.json" ,
1756+ "filecache::s3://yet-another-fsspec/file.json" ,
17561757 "https://example-site.com/data" ,
17571758 "some-protocol://data.txt" ,
17581759 ],
Original file line number Diff line number Diff line change @@ -501,6 +501,15 @@ def test_is_fsspec_url():
501501 assert icom .is_fsspec_url ("RFC-3986+compliant.spec://something" )
502502
503503
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+
504513@pytest .mark .parametrize ("encoding" , [None , "utf-8" ])
505514@pytest .mark .parametrize ("format" , ["csv" , "json" ])
506515def test_codecs_encoding (encoding , format ):
You can’t perform that action at this time.
0 commit comments