Fokko commented on code in PR #1788: URL: https://github.com/apache/iceberg-python/pull/1788#discussion_r1992187967
########## pyiceberg/io/fsspec.py: ########## @@ -124,6 +128,22 @@ def _file(_: Properties) -> LocalFileSystem: return LocalFileSystem(auto_mkdir=True) +def _oss(properties: Properties) -> AbstractFileSystem: + from s3fs import S3FileSystem + + client_kwargs = { + "endpoint_url": properties.get(OSS_ENDPOINT), + "aws_access_key_id": properties.get(OSS_ACCESS_KEY_ID), + "aws_secret_access_key": properties.get(OSS_ACCESS_KEY_SECRET), + "aws_session_token": properties.get(OSS_SESSION_TOKEN), + } + config_kwargs = {"s3": {"addressing_style": "virtual"}, "signature_version": "v4"} + + fs = S3FileSystem(client_kwargs=client_kwargs, config_kwargs=config_kwargs) + + return fs Review Comment: Less is more! ```suggestion return S3FileSystem(client_kwargs=client_kwargs, config_kwargs=config_kwargs) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org