Fokko commented on code in PR #340:
URL: https://github.com/apache/iceberg-python/pull/340#discussion_r1474086423


##########
pyiceberg/catalog/rest.py:
##########
@@ -472,6 +488,7 @@ def create_table(
         table_response = TableResponse(**response.json())
         return self._response_to_table(self.identifier_to_tuple(identifier), 
table_response)
 
+    @retry(retry=retry_if_exception_type(AuthorizationExpiredError), 
stop=stop_after_attempt(2), before=_retry_hook, reraise=True)

Review Comment:
   Instead of adding the decorators everywhere, maybe we can wrap the logic in 
`_handle_non_200_response`. The major issue I see with the current approach is:
   
   - The decorater is duplicated many times
   - It is easy to miss a certain method, for example, `_do_commit()` is also 
very likely to time out when you do a write operation that takes some time.



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

Reply via email to