kevinjqliu commented on code in PR #2600:
URL: https://github.com/apache/iceberg-python/pull/2600#discussion_r2696488606
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -466,11 +481,42 @@ def _response_to_staged_table(self, identifier_tuple:
Tuple[str, ...], table_res
metadata_location=table_response.metadata_location, # type: ignore
metadata=table_response.metadata,
io=self._load_file_io(
- {**table_response.metadata.properties,
**table_response.config}, table_response.metadata_location
+ {
+ **table_response.metadata.properties,
+ **self._get_credentials(
+ table_response.storage_credentials,
+ table_response.config,
+ table_response.metadata_location,
+ getattr(table_response.metadata, "location", None),
Review Comment:
i wonder if its necessary to include the "metadata location" here as a
fallback; or just always use `table_response.metadata_location`
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -152,10 +152,16 @@ def _retry_hook(retry_state: RetryCallState) -> None:
}
+class StorageCredential(IcebergBaseModel):
+ prefix: str = Field()
+ config: Properties = Field()
+
+
class TableResponse(IcebergBaseModel):
metadata_location: Optional[str] = Field(alias="metadata-location",
default=None)
metadata: TableMetadata
config: Properties = Field(default_factory=dict)
+ storage_credentials: Optional[List[StorageCredential]] =
Field(alias="storage-credentials", default=None)
Review Comment:
nit: might be easier to just just List here
```suggestion
storage_credentials: List[StorageCredential] = Field(
default_factory=list,
alias="storage-credentials"
)
```
--
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]