sungwy commented on code in PR #2846:
URL: https://github.com/apache/iceberg-python/pull/2846#discussion_r2645920570


##########
pyiceberg/io/fsspec.py:
##########
@@ -121,9 +121,19 @@ def __call__(self, request: "AWSRequest", **_: Any) -> 
None:
         signer_url = self.properties.get(S3_SIGNER_URI, 
self.properties[URI]).rstrip("/")  # type: ignore
         signer_endpoint = self.properties.get(S3_SIGNER_ENDPOINT, 
S3_SIGNER_ENDPOINT_DEFAULT)
 
-        signer_headers = {}
+        signer_headers: dict[str, str] = {}
+
+        auth_header: str | None = None
         if token := self.properties.get(TOKEN):
-            signer_headers = {"Authorization": f"Bearer {token}"}
+            auth_header = f"Bearer {token}"

Review Comment:
   This may be out of scope for this bug-fix PR, but it looks like we’re 
tightly coupling `AuthManager` and authentication tokens which are 
`RestCatalog` concepts into `FileIO`, which should be `Catalog` type agnostic.
   
   It might be worth revisiting this design in more detail in the future to 
ensure we don’t introduce fallback logic that’s driven by configuration 
properties rather than clearer separation of concerns



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