Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion py-polars/src/polars/io/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from collections.abc import Iterator, Sequence
from contextlib import AbstractContextManager as ContextManager

_URL_REGEX = re.compile(r"^(ht|f)tps?://", re.IGNORECASE)


def parse_columns_arg(
columns: Sequence[str] | Sequence[int] | str | int | None,
Expand Down Expand Up @@ -291,7 +293,7 @@ def _check_empty(


def looks_like_url(path: str) -> bool:
return re.match("^(ht|f)tps?://", path, re.IGNORECASE) is not None
return _URL_REGEX.match(path) is not None


def process_file_url(path: str, encoding: str | None = None) -> BytesIO:
Expand Down