Skip to content

Commit d13d4ba

Browse files
author
garrett.weaver
committed
add support to configure anonymous in s3 client
1 parent 76a6451 commit d13d4ba

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

pyiceberg/io/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
AWS_SESSION_TOKEN = "client.session-token"
5353
AWS_ROLE_ARN = "client.role-arn"
5454
AWS_ROLE_SESSION_NAME = "client.role-session-name"
55+
S3_ANONYMOUS = "s3.anonymous"
5556
S3_ENDPOINT = "s3.endpoint"
5657
S3_ACCESS_KEY_ID = "s3.access-key-id"
5758
S3_SECRET_ACCESS_KEY = "s3.secret-access-key"

pyiceberg/io/fsspec.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
HF_ENDPOINT,
6666
HF_TOKEN,
6767
S3_ACCESS_KEY_ID,
68+
S3_ANONYMOUS,
6869
S3_CONNECT_TIMEOUT,
6970
S3_ENDPOINT,
7071
S3_PROXY_URI,
@@ -163,6 +164,9 @@ def _s3(properties: Properties) -> AbstractFileSystem:
163164

164165
if request_timeout := properties.get(S3_REQUEST_TIMEOUT):
165166
config_kwargs["read_timeout"] = float(request_timeout)
167+
168+
if s3_anonymous := properties.get(S3_ANONYMOUS):
169+
config_kwargs["anon"] = bool(s3_anonymous)
166170

167171
fs = S3FileSystem(client_kwargs=client_kwargs, config_kwargs=config_kwargs)
168172

0 commit comments

Comments
 (0)