Bug Fix: metadata_location to be optional in TableResponse#1321
Bug Fix: metadata_location to be optional in TableResponse#1321kevinjqliu merged 4 commits intoapache:mainfrom
metadata_location to be optional in TableResponse#1321Conversation
metadata_location optional metadata_location to be optional in TableResponse
Fokko
left a comment
There was a problem hiding this comment.
Hey @sungwy this is a great catch! Since @kevinjqliu is the release manager, we can either follow up with this in 0.8.1 or cut another RC with this fix included.
I think it would be good to have a test to cover this. It should be pretty straightforward by adding another fixture that covers this case:
https://github.com/apache/iceberg-python/blob/2ba86b5c852cb0c8f4b4ba95d54fb5a6bfa00fa2/tests/catalog/test_rest.py#L70-L79
WDYT?
Just a test for testing the creation of a staged table @Fokko - thank you for the suggestion!
And yes, I agree it'll be fine either way. I'll leave it up to the captain 🚢 |
kevinjqliu
left a comment
There was a problem hiding this comment.
LGTM! Lets cut another RC for this
iceberg
Outdated
There was a problem hiding this comment.
good question - I'll get it removed
…e#1321) * make metadata_location optional * add test for staged creation * revert * revert from testing
…e#1321) * make metadata_location optional * add test for staged creation * revert * revert from testing
While testing out the iceberg-rest-catalog docker image, I ran into the following error when parsing the following example TableResponse that is created in
tests/integration/test_writes/test_writes.py::test_create_table_transaction[session_catalog-2]Error trace
The following is noted from pydantic docs:
@kevinjqliu I think this is a bug that we should consider in cutting out a new RC for the ongoing 0.8.0 release. The implication of not fixing this bug, is that TableResponse from staged tables cannot be parsed by PyIceberg and will lead to a fatal exception :(
According to the Iceberg Rest Catalog Spec, the metadata-location is an optional field, and may be absent from the TableResponse
https://github.com/apache/iceberg/blob/3659ded18d50206576985339bd55cd82f5e200cc/open-api/rest-catalog-open-api.yaml#L3201-L3208