Tommo56700 commented on code in PR #3063:
URL: https://github.com/apache/iceberg-python/pull/3063#discussion_r2821173484


##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -680,11 +684,25 @@ def _init_sigv4(self, session: Session) -> None:
         from botocore.awsrequest import AWSRequest
         from requests import PreparedRequest
         from requests.adapters import HTTPAdapter
+        from urllib3.util.retry import Retry
 
         class SigV4Adapter(HTTPAdapter):
             def __init__(self, **properties: str):
-                super().__init__()
                 self._properties = properties
+                max_retries = property_as_int(self._properties, 
SIGV4_MAX_RETRIES, SIGV4_DEFAULT_MAX_RETRIES)
+                super().__init__(
+                    max_retries=Retry(
+                        total=max_retries,
+                        status=max_retries,
+                        connect=max_retries,
+                        read=max_retries,
+                        # Keep retries conservative for idempotent calls.
+                        allowed_methods=frozenset({"GET", "HEAD", "OPTIONS"}),
+                        status_forcelist=SIGV4_RETRY_STATUS_CODES,
+                        backoff_factor=SIGV4_RETRY_BACKOFF_FACTOR,
+                        respect_retry_after_header=True,
+                    )
+                )
                 self._boto_session = boto3.Session(
                     region_name=get_first_property_value(self._properties, 
AWS_REGION),

Review Comment:
   Potentially this should also be aligned with the glue catalog? E.g. 
inclusion of profile name:
   
https://github.com/apache/iceberg-python/blob/9687d080f28951464cf02fb2645e2a1185838b21/pyiceberg/catalog/glue.py#L332



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