Anurag-S1ngh opened a new pull request, #4329:
URL: https://github.com/apache/iceberg-python/pull/4329
# Rationale for this change
A staged REST create returns no `metadata-location`, but
`_response_to_staged_table` matched the vended `storage-credentials` against
that missing location. `_resolve_storage_credentials` returns `{}` for a falsy
location, so the staged table's `FileIO` never received the credentials and
writes fell back to ambient credentials or failed without them. `create_table`
with the same response kept the credentials.
The staged path now matches against the table location from
`metadata.location`, with a trailing slash so a credential prefix like
`gs://bucket/ns/t/` matches, while `create_table` is unchanged.
# Are these changes tested?
Yes.
`tests/catalog/test_rest.py::test_create_staged_table_with_storage_credentials`
returns a staged response with `storage-credentials` and no
`metadata-location`, then asserts the vended token reaches the staged table's
`FileIO`. On main the test fails with `KeyError: 'gcs.oauth2.token'`.
Full unit suite: `4532 passed, 5 skipped`. `prek run -a` passes.
# Are there any user-facing changes?
Yes. `create_table_transaction` now keeps the vended storage credentials
returned by the REST catalog for staged creates, matching the behavior of
`create_table`.
Closes #4325
--
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]