This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git


The following commit(s) were added to refs/heads/main by this push:
     new 0c3fc4d  Cast env var `s3.connect-timeout` to float (#259)
0c3fc4d is described below

commit 0c3fc4d13646175ce48eae27997272b46f632961
Author: Sung Yun <[email protected]>
AuthorDate: Wed Jan 10 12:48:01 2024 -0500

    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 cfb14f2..6887007 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 f155113..9faf4ce 100644
--- a/pyiceberg/io/pyarrow.py
+++ b/pyiceberg/io/pyarrow.py
@@ -321,7 +321,7 @@ class PyArrowFileIO(FileIO):
         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 @@ class PyArrowFileIO(FileIO):
                 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":

Reply via email to