Skip to content

Commit

Permalink
Cast env var s3.connect-timeout to float (apache#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungwy authored Jan 10, 2024
1 parent feafbf0 commit 0c3fc4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyiceberg/io/fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions pyiceberg/io/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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":
Expand Down

0 comments on commit 0c3fc4d

Please sign in to comment.