From 4cf1039cbac14fd6d77bc93e751e5f45ea33bc1c Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Mon, 21 Oct 2024 20:08:02 +1100 Subject: [PATCH] c --- py-polars/polars/io/cloud/_utils.py | 45 ----------------------------- 1 file changed, 45 deletions(-) diff --git a/py-polars/polars/io/cloud/_utils.py b/py-polars/polars/io/cloud/_utils.py index 330581597db5..3d92f3a71ad8 100644 --- a/py-polars/polars/io/cloud/_utils.py +++ b/py-polars/polars/io/cloud/_utils.py @@ -20,39 +20,6 @@ def _first_scan_path( return None -def _infer_cloud_type( - source: ScanSource, -) -> Literal["aws", "azure", "gcp", "file", "http", "hf"] | None: - if (path := _first_scan_path(source)) is None: - return None - - scheme = _get_path_scheme(path) - - # Fast path - local file - if not scheme: - return None - - if scheme == "file": - return "file" - - if _is_aws_cloud(scheme): - return "aws" - - if _is_azure_cloud(scheme): - return "azure" - - if _is_gcp_cloud(scheme): - return "gcp" - - if _is_http_cloud(scheme): - return "http" - - if _is_hf_cloud(scheme): - return "hf" - - return None - - def _get_path_scheme(path: str | Path) -> str | None: splitted = str(path).split("://", maxsplit=1) @@ -63,17 +30,5 @@ def _is_aws_cloud(scheme: str) -> bool: return any(scheme == x for x in ["s3", "s3a"]) -def _is_azure_cloud(scheme: str) -> bool: - return any(scheme == x for x in ["az", "azure", "adl", "abfs", "abfss"]) - - def _is_gcp_cloud(scheme: str) -> bool: return any(scheme == x for x in ["gs", "gcp", "gcs"]) - - -def _is_http_cloud(scheme: str) -> bool: - return any(scheme == x for x in ["http", "https"]) - - -def _is_hf_cloud(scheme: str) -> bool: - return scheme == "hf"