010Soham commented on code in PR #2846:
URL: https://github.com/apache/iceberg-python/pull/2846#discussion_r2663953951


##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -364,16 +359,24 @@ def _create_session(self) -> Session:
             if auth_type != CUSTOM and auth_impl:
                 raise ValueError("auth.impl can only be specified when using 
custom auth.type")
 
-            session.auth = 
AuthManagerAdapter(AuthManagerFactory.create(auth_impl or auth_type, 
auth_type_config))
+            self._auth_manager = AuthManagerFactory.create(auth_impl or 
auth_type, auth_type_config)
+            session.auth = AuthManagerAdapter(self._auth_manager)
         else:
-            session.auth = 
AuthManagerAdapter(self._create_legacy_oauth2_auth_manager(session))
+            self._auth_manager = 
self._create_legacy_oauth2_auth_manager(session)
+            session.auth = AuthManagerAdapter(self._auth_manager)
 
         # Configure SigV4 Request Signing
         if property_as_bool(self.properties, SIGV4, False):
             self._init_sigv4(session)
 
         return session
 
+    def _load_file_io(self, properties: Properties = EMPTY_DICT, location: str 
| None = None) -> FileIO:
+        merged_properties = {**self.properties, **properties}
+        if self._auth_manager:
+            merged_properties[AUTH_MANAGER] = self._auth_manager
+        return load_file_io(merged_properties, location)
+

Review Comment:
   We are using it when the REST catalog builds tables. For example, 
_response_to_table and _response_to_staged_table call self._load_file_io(...) 
to construct the Table’s FileIO.



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