Title: Fix CommitTableRequest serialisation by kdbhiggins · Pull Request #525 · apache/iceberg-python · GitHub
Open Graph Title: Fix CommitTableRequest serialisation by kdbhiggins · Pull Request #525 · apache/iceberg-python
X Title: Fix CommitTableRequest serialisation by kdbhiggins · Pull Request #525 · apache/iceberg-python
Description: I discovered an error when trying to deserialize the CommitTableRequest object. request = CommitTableRequest( requirements=(AssertTableUUID(uuid='4bfd18a3-74c6-478e-98b1-71c4c32f4163'),), identifier=TableIdentifier(namespace=['a'], name='b'), ) deserialized_request = CommitTableRequest.model_validate_json(request.model_dump_json()) raises TypeError: Can't instantiate abstract class TableRequirement with abstract method validate I added a test to round-trip serialize/deserialize the CommitTableRequest. After investigating I was able to fix it by using Discriminated Unions, which seem like a natural fit for the TableUpdate and TableRequirement.
Open Graph Description: I discovered an error when trying to deserialize the CommitTableRequest object. request = CommitTableRequest( requirements=(AssertTableUUID(uuid='4bfd18a3-74c6-478e-98b1-71c4c32f4163...
X Description: I discovered an error when trying to deserialize the CommitTableRequest object. request = CommitTableRequest( requirements=(AssertTableUUID(uuid='4bfd18a3-74c6-478e-98b1-71c4c32f416...
Opengraph URL: https://github.com/apache/iceberg-python/pull/525
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/commits/:range(.:format) |
| route-controller | pull_requests |
| route-action | commits |
| fetch-nonce | v2:b8769637-3e34-35e8-d061-a9a5b75e8c0b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ED34:23810A:3C5170E:4EC7148:6992DB82 |
| html-safe-nonce | 30a6c7a182b20c81e16b3b293e6714f11b9793b1c84bba994bdc692c9a057b74 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDM0OjIzODEwQTozQzUxNzBFOjRFQzcxNDg6Njk5MkRCODIiLCJ2aXNpdG9yX2lkIjoiNTQ4NjQ0MTc3MzE1MTczODc1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a1f1bbf04736599c85607872b2fa5338f75963652e9f0d2f0c37348fc7ee3477 |
| hovercard-subject-tag | pull_request:1774646383 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/apache/iceberg-python/pull/525/commits/ca982ccbd9820dd41cc077b08779fe48047a0fac |
| twitter:image | https://avatars.githubusercontent.com/u/2725945?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2725945?s=400&v=4 |
| og:image:alt | I discovered an error when trying to deserialize the CommitTableRequest object. request = CommitTableRequest( requirements=(AssertTableUUID(uuid='4bfd18a3-74c6-478e-98b1-71c4c32f4163... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/apache/iceberg-python git https://github.com/apache/iceberg-python.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 677260606 |
| octolytics-dimension-repository_nwo | apache/iceberg-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 677260606 |
| octolytics-dimension-repository_network_root_nwo | apache/iceberg-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84dcb133269e3cfe6e0296cc85fbacb92cae92bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width