robreeves opened a new pull request, #3295: URL: https://github.com/apache/iceberg-python/pull/3295
# Rationale for this change `copy.deepcopy()` on `And`, `Or`, and `Not` expressions raises `TypeError` because Pydantic v2's default `__deepcopy__` calls `cls.__new__(cls)` with no args, but these classes require positional arguments in `__new__`. This breaks frameworks like Ray Train that deepcopy objects containing pyiceberg expression trees. The fix adds `__deepcopy__` to `And`, `Or`, and `Not` that deepcopy their fields and call the constructor directly. ## Are these changes tested? Yes. 11 new unit tests covering all expression types, balanced trees, nested expressions, and deepcopy followed by pickle. ## Are there any user-facing changes? No. `copy.deepcopy()` on expressions now works instead of raising. -- 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]
