jaimeferj commented on code in PR #2565:
URL: https://github.com/apache/iceberg-python/pull/2565#discussion_r2445234392
##########
pyiceberg/expressions/__init__.py:
##########
@@ -302,12 +302,19 @@ def __getnewargs__(self) -> Tuple[BooleanExpression,
BooleanExpression]:
return (self.left, self.right)
-class Or(BooleanExpression):
+class Or(IcebergBaseModel, BooleanExpression):
"""OR operation expression - logical disjunction."""
+ model_config = ConfigDict(arbitrary_types_allowed=True)
+
+ type: TypingLiteral["str"] = Field(default="or", alias="type")
left: BooleanExpression
right: BooleanExpression
+ def __init__(self, left: BooleanExpression, right: BooleanExpression,
*rest: BooleanExpression) -> None:
+ if isinstance(self, Or) and not hasattr(self, "left") and not
hasattr(self, "right"):
+ super().__init__(left=left, right=right)
+
Review Comment:
Another thing, the tests are passing in mi implementation, as far as I know,
so you know that Or is being instantiated correctly, right?
##########
pyiceberg/expressions/__init__.py:
##########
@@ -302,12 +302,19 @@ def __getnewargs__(self) -> Tuple[BooleanExpression,
BooleanExpression]:
return (self.left, self.right)
-class Or(BooleanExpression):
+class Or(IcebergBaseModel, BooleanExpression):
"""OR operation expression - logical disjunction."""
+ model_config = ConfigDict(arbitrary_types_allowed=True)
+
+ type: TypingLiteral["str"] = Field(default="or", alias="type")
left: BooleanExpression
right: BooleanExpression
+ def __init__(self, left: BooleanExpression, right: BooleanExpression,
*rest: BooleanExpression) -> None:
+ if isinstance(self, Or) and not hasattr(self, "left") and not
hasattr(self, "right"):
+ super().__init__(left=left, right=right)
+
Review Comment:
Another thing, the tests are passing in my implementation, as far as I know,
so you know that Or is being instantiated correctly, right?
--
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]