CircArgs commented on code in PR #4816:
URL: https://github.com/apache/iceberg/pull/4816#discussion_r889187063
##########
python/src/iceberg/expressions/base.py:
##########
@@ -267,6 +226,68 @@ def __str__(self) -> str:
return "false"
+class UnboundIn(BooleanExpression, UnboundPredicate):
+ """IN operation expression"""
+
+ def __init__(self, left: "UnboundReference", right: List[Literal]): #
pylint: disable=super-init-not-called
+ self._left = left
+ self._right = right
+
+ @property
+ def left(self) -> "UnboundReference":
+ return self._left
+
+ @property
+ def right(self) -> List[Literal]:
+ return self._right
+
+ def __eq__(self, other) -> bool:
+ return id(self) == id(other) or (isinstance(other, UnboundIn) and
self.left == other.left and self.right == other.right)
+
+ def __invert__(self) -> Not:
+ return Not(self)
+
+ def __repr__(self) -> str:
+ return f"UnboundIn({repr(self.left)}, {repr(self.right)})"
+
+ def __str__(self) -> str:
+ return f"({self.left} in {self.right})"
+
+ def bind(self, schema: Schema, case_sensitive: bool) -> "In":
+ return In(self.left.bind(schema, case_sensitive), self.right)
Review Comment:
call `.to` in a list comprehension now
##########
python/src/iceberg/expressions/base.py:
##########
@@ -267,6 +226,68 @@ def __str__(self) -> str:
return "false"
+class UnboundIn(BooleanExpression, UnboundPredicate):
+ """IN operation expression"""
+
+ def __init__(self, left: "UnboundReference", right: List[Literal]): #
pylint: disable=super-init-not-called
+ self._left = left
+ self._right = right
+
+ @property
+ def left(self) -> "UnboundReference":
+ return self._left
+
+ @property
+ def right(self) -> List[Literal]:
+ return self._right
+
+ def __eq__(self, other) -> bool:
+ return id(self) == id(other) or (isinstance(other, UnboundIn) and
self.left == other.left and self.right == other.right)
+
+ def __invert__(self) -> Not:
+ return Not(self)
+
+ def __repr__(self) -> str:
Review Comment:
uses dataclasses
--
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]