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


##########
python/pyiceberg/expressions/__init__.py:
##########
@@ -32,6 +41,24 @@
 B = TypeVar("B")
 
 
+def _to_literal(lit: Optional[Union[T, Literal[T]]]) -> Optional[Literal[T]]:
+    # This should not be optional, to be fixed in a separate PR
+    if lit:
+        return lit if isinstance(lit, Literal) else literal(lit)
+    else:
+        return None
+
+
+def _combine_into_set(values: Tuple[Union[T, Literal[T], Iterable[T], 
Iterable[Literal[T]]], ...]) -> Set[Literal[T]]:

Review Comment:
   From the signature of the `__new__` function of 
`{In,NotIn,BoundIn,BoundNotIn}` you can see that you can also provide 
positional arguments, I think that's a nice touch:
   ```python
   def test_in_positional_args():
       assert In(Reference("foo"), "a", "bc", "def").literals == 
{StringLiteral("a"), StringLiteral("bc"), StringLiteral("def")}
   ```



-- 
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