Fokko commented on code in PR #7519:
URL: https://github.com/apache/iceberg/pull/7519#discussion_r1185092875
##########
python/pyiceberg/catalog/rest.py:
##########
@@ -335,6 +349,53 @@ def _handle_non_200_response(self, exc: HTTPError,
error_handler: Dict[int, Type
raise exception(response) from exc
+ def _init_sigv4(self) -> None:
+ from urllib import parse
+
+ import boto3
+ from botocore.auth import SigV4Auth
+ from botocore.awsrequest import AWSRequest
+ from requests import PreparedRequest
+ from requests.adapters import HTTPAdapter
+
+ class SigV4Adapter(HTTPAdapter):
+ def __init__(self, **properties: str):
+ super().__init__()
+ self._properties = properties
+
+ def add_headers(self, request: PreparedRequest, **kwargs: Any) ->
None: # pylint: disable=W0613
+ session = boto3.Session()
+ credentials = session.get_credentials()
+ creds = credentials.get_frozen_credentials()
Review Comment:
nit. Maybe do:
```python
credentials = session.get_credentials().get_frozen_credentials()
```
This way we avoid similar variable names `creds` and `credentials`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]