jayceslesar commented on code in PR #2071:
URL: https://github.com/apache/iceberg-python/pull/2071#discussion_r2134724259


##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -390,11 +392,17 @@ class SigV4Adapter(HTTPAdapter):
             def __init__(self, **properties: str):
                 super().__init__()
                 self._properties = properties
+                self._boto_session = boto3.Session(
+                    region_name=get_first_property_value(self._properties, 
AWS_REGION),
+                    botocore_session=self._properties.get(BOTOCORE_SESSION),
+                    
aws_access_key_id=get_first_property_value(self._properties, AWS_ACCESS_KEY_ID),
+                    
aws_secret_access_key=get_first_property_value(self._properties, 
AWS_SECRET_ACCESS_KEY),
+                    
aws_session_toxken=get_first_property_value(self._properties, 
AWS_SESSION_TOKEN),
+                )
 
             def add_headers(self, request: PreparedRequest, **kwargs: Any) -> 
None:  # pylint: disable=W0613
-                boto_session = boto3.Session()
-                credentials = 
boto_session.get_credentials().get_frozen_credentials()
-                region = self._properties.get(SIGV4_REGION, 
boto_session.region_name)

Review Comment:
   @Fokko @kevinjqliu probably worth refactoring this class out to get some 
proper test coverage?



-- 
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]

Reply via email to