diff --git a/py-polars/polars/io/csv/functions.py b/py-polars/polars/io/csv/functions.py index daebcf452c1e..0483d058180b 100644 --- a/py-polars/polars/io/csv/functions.py +++ b/py-polars/polars/io/csv/functions.py @@ -1036,7 +1036,7 @@ def scan_csv( decimal_comma: bool = False, glob: bool = True, storage_options: dict[str, Any] | None = None, - credential_provider: CredentialProviderFunction | Literal["auto"] | None = None, + credential_provider: CredentialProviderFunction | Literal["auto"] | None = "auto", retries: int = 2, file_cache_ttl: int | None = None, include_file_paths: str | None = None, diff --git a/py-polars/polars/io/ipc/functions.py b/py-polars/polars/io/ipc/functions.py index 1348134fc0d6..b8af12ae8806 100644 --- a/py-polars/polars/io/ipc/functions.py +++ b/py-polars/polars/io/ipc/functions.py @@ -364,7 +364,7 @@ def scan_ipc( row_index_name: str | None = None, row_index_offset: int = 0, storage_options: dict[str, Any] | None = None, - credential_provider: CredentialProviderFunction | Literal["auto"] | None = None, + credential_provider: CredentialProviderFunction | Literal["auto"] | None = "auto", memory_map: bool = True, retries: int = 2, file_cache_ttl: int | None = None, diff --git a/py-polars/polars/io/ndjson.py b/py-polars/polars/io/ndjson.py index 983b8cddcfe1..7da4635408d1 100644 --- a/py-polars/polars/io/ndjson.py +++ b/py-polars/polars/io/ndjson.py @@ -38,7 +38,7 @@ def read_ndjson( row_index_offset: int = 0, ignore_errors: bool = False, storage_options: dict[str, Any] | None = None, - credential_provider: CredentialProviderFunction | Literal["auto"] | None = None, + credential_provider: CredentialProviderFunction | Literal["auto"] | None = "auto", retries: int = 2, file_cache_ttl: int | None = None, include_file_paths: str | None = None, @@ -206,7 +206,7 @@ def scan_ndjson( row_index_offset: int = 0, ignore_errors: bool = False, storage_options: dict[str, Any] | None = None, - credential_provider: CredentialProviderFunction | Literal["auto"] | None = None, + credential_provider: CredentialProviderFunction | Literal["auto"] | None = "auto", retries: int = 2, file_cache_ttl: int | None = None, include_file_paths: str | None = None, diff --git a/py-polars/polars/io/parquet/functions.py b/py-polars/polars/io/parquet/functions.py index 16ff7f614349..0cc91a94693f 100644 --- a/py-polars/polars/io/parquet/functions.py +++ b/py-polars/polars/io/parquet/functions.py @@ -54,7 +54,7 @@ def read_parquet( rechunk: bool = False, low_memory: bool = False, storage_options: dict[str, Any] | None = None, - credential_provider: CredentialProviderFunction | Literal["auto"] | None = None, + credential_provider: CredentialProviderFunction | Literal["auto"] | None = "auto", retries: int = 2, use_pyarrow: bool = False, pyarrow_options: dict[str, Any] | None = None, @@ -338,7 +338,7 @@ def scan_parquet( low_memory: bool = False, cache: bool = True, storage_options: dict[str, Any] | None = None, - credential_provider: CredentialProviderFunction | Literal["auto"] | None = None, + credential_provider: CredentialProviderFunction | Literal["auto"] | None = "auto", retries: int = 2, include_file_paths: str | None = None, allow_missing_columns: bool = False, diff --git a/py-polars/tests/unit/io/cloud/test_cloud.py b/py-polars/tests/unit/io/cloud/test_cloud.py index f943ab5e2c26..54d1b5ccd6a6 100644 --- a/py-polars/tests/unit/io/cloud/test_cloud.py +++ b/py-polars/tests/unit/io/cloud/test_cloud.py @@ -1,3 +1,5 @@ +from functools import partial + import pytest import polars as pl @@ -11,6 +13,11 @@ def test_scan_nonexistent_cloud_path_17444(format: str) -> None: path_str = f"s3://my-nonexistent-bucket/data.{format}" scan_function = getattr(pl, f"scan_{format}") + # Prevent automatic credential provideder instantiation, otherwise CI may fail with + # * pytest.PytestUnraisableExceptionWarning: + # * Exception ignored: + # * ResourceWarning: unclosed socket + scan_function = partial(scan_function, credential_provider=None) # Just calling the scan function should not raise any errors if format == "ndjson":