Skip to content

Commit f05dec5

Browse files
committed
extract the target file to access when chained URLs are used
1 parent 0f0ac4e commit f05dec5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/io/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,9 @@ def infer_compression(
584584
# Infer compression
585585
if compression == "infer":
586586
# Convert all path types (e.g. pathlib.Path) to strings
587+
if "::" in filepath_or_buffer:
588+
# chained URLs contain ::
589+
filepath_or_buffer = filepath_or_buffer.split("::")[0]
587590
filepath_or_buffer = stringify_path(filepath_or_buffer, convert_file_like=True)
588591
if not isinstance(filepath_or_buffer, str):
589592
# Cannot infer compression of a buffer, assume no compression

0 commit comments

Comments
 (0)