Skip to content

Commit 6f71f21

Browse files
committed
Make And expression JSON serializable using Pydantic
1 parent 536e2b8 commit 6f71f21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pyiceberg/expressions/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ def __new__(cls, left: BooleanExpression, right: BooleanExpression, *rest: Boole
272272
elif right is AlwaysTrue():
273273
return left
274274
else:
275-
return cls(left=left, right=right)
275+
obj = super().__new__(cls)
276+
obj.__pydantic_fields_set__ = set()
277+
obj.left = left
278+
obj.right = right
279+
return obj
276280

277281
def __eq__(self, other: Any) -> bool:
278282
"""Return the equality of two instances of the And class."""

0 commit comments

Comments
 (0)