Conversation
0aba3ac to
dc42e88
Compare
dc42e88 to
a68add0
Compare
sungwy
left a comment
There was a problem hiding this comment.
This is really cool 🔥 - thank you for putting in this bug fix so quickly!
This is a nit: I think we could add a test to test_metadata.py to deepcopy a TableMetadata object and ensure that the output is equal to the original one with a Schema representation that contains a mix of the issue affected types.
Theoretically this will work, but its never a bad thing to add an explicit test to demonstrate that the issue is resolved. But other than that, this looks great! Such a speedy resolution of a rather opaque issue 🚀
|
Thank you, @syun64. I have added the test and used an existing metadata definition to avoid duplication. Regarding the solution, to be honest, it was not quick. It took me several weeks of learning and then stepping away from the problem for a few weeks to return with fresh ideas on how to solve it. |
5bad46b to
db8b151
Compare
kevinjqliu
left a comment
There was a problem hiding this comment.
Thanks for addressing this 🐛!
db8b151 to
4fb7090
Compare
4fb7090 to
76127a5
Compare
|
@ndrluis Thanks for pinging me here. This approval should be gone once the first PR has been merged. Which should be soon 🚀 |
|
Thanks @ndrluis for working on this, and @syun64, @kevinjqliu and @HonahX for the quick review 🚀 |

The IcebergRootModel inherits from Pydantic RootModel, which has its own implementation of deepcopy. When deepcopy runs, it calls this
__deepcopy__method and ignores that it's a Singleton. So, my solution was to change the order of inheritance and implement a__deepcopy__method for singletons that returns itself.https://github.com/pydantic/pydantic/blob/f024d03b832d1bbcbadf76184ed14d92571a71ca/pydantic/root_model.py#L108-L116