rdblue commented on code in PR #6139:
URL: https://github.com/apache/iceberg/pull/6139#discussion_r1027143128


##########
python/pyiceberg/expressions/__init__.py:
##########
@@ -385,145 +498,174 @@ def __new__(cls, term: BoundTerm[T], literals: 
set[Literal[T]]):  # pylint: disa
         else:
             return super().__new__(cls)
 
-    def __invert__(self) -> BoundIn[T]:
+    def __invert__(self) -> BoundIn[L]:
         return BoundIn(self.term, self.literals)
 
 
-@dataclass(frozen=True)
-class In(SetPredicate[T]):
-    as_bound = BoundIn
-
-    def __new__(cls, term: UnboundTerm[T], literals: tuple[Literal[T], ...]):  
# pylint: disable=W0221
-        count = len(literals)
+class In(SetPredicate[L]):
+    def __new__(cls, term: Union[str, UnboundTerm], literals: 
Union[Iterable[L], Iterable[Literal[L]]]):  # pylint: disable=W0221
+        literals_set: Set[Literal[L]] = _to_literal_set(literals)
+        count = len(literals_set)
         if count == 0:
             return AlwaysFalse()
         elif count == 1:
-            return EqualTo(term, literals[0])
+            return EqualTo(term, next(iter(literals)))
         else:
             return super().__new__(cls)
 
-    def __invert__(self) -> NotIn[T]:
-        return NotIn(self.term, self.literals)
+    def __invert__(self) -> NotIn:

Review Comment:
   Missing `[L]` for the return type?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to