kdbhiggins opened a new pull request, #525:
URL: https://github.com/apache/iceberg-python/pull/525

     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](https://docs.pydantic.dev/latest/concepts/unions/#discriminated-unions),
 which seem like a natural fit for the `TableUpdate` and `TableRequirement`. 


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to