From 0c3fc4d13646175ce48eae27997272b46f632961 Mon Sep 17 00:00:00 2001 From: Sung Yun <107272191+syun64@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:48:01 -0500 Subject: [PATCH] Cast env var `s3.connect-timeout` to float (#259) --- pyiceberg/io/fsspec.py | 2 +- pyiceberg/io/pyarrow.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyiceberg/io/fsspec.py b/pyiceberg/io/fsspec.py index cfb14f240f..6887007c7f 100644 --- a/pyiceberg/io/fsspec.py +++ b/pyiceberg/io/fsspec.py @@ -130,7 +130,7 @@ def _s3(properties: Properties) -> AbstractFileSystem: config_kwargs["proxies"] = {"http": proxy_uri, "https": proxy_uri} if connect_timeout := properties.get(S3_CONNECT_TIMEOUT): - config_kwargs["connect_timeout"] = connect_timeout + config_kwargs["connect_timeout"] = float(connect_timeout) fs = S3FileSystem(client_kwargs=client_kwargs, config_kwargs=config_kwargs) diff --git a/pyiceberg/io/pyarrow.py b/pyiceberg/io/pyarrow.py index f1551133be..9faf4cec56 100644 --- a/pyiceberg/io/pyarrow.py +++ b/pyiceberg/io/pyarrow.py @@ -321,7 +321,7 @@ def _initialize_fs(self, scheme: str, netloc: Optional[str] = None) -> FileSyste if scheme in {"s3", "s3a", "s3n"}: from pyarrow.fs import S3FileSystem - client_kwargs = { + client_kwargs: Dict[str, Any] = { "endpoint_override": self.properties.get(S3_ENDPOINT), "access_key": self.properties.get(S3_ACCESS_KEY_ID), "secret_key": self.properties.get(S3_SECRET_ACCESS_KEY), @@ -333,7 +333,7 @@ def _initialize_fs(self, scheme: str, netloc: Optional[str] = None) -> FileSyste client_kwargs["proxy_options"] = proxy_uri if connect_timeout := self.properties.get(S3_CONNECT_TIMEOUT): - client_kwargs["connect_timeout"] = connect_timeout + client_kwargs["connect_timeout"] = float(connect_timeout) return S3FileSystem(**client_kwargs) elif scheme == "hdfs":