Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Oct 21, 2024
1 parent ddf721f commit 4cf1039
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions py-polars/polars/io/cloud/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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"

0 comments on commit 4cf1039

Please sign in to comment.