rdblue commented on code in PR #6139: URL: https://github.com/apache/iceberg/pull/6139#discussion_r1017237937
########## 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: I'm fine with positional args (or not) but what I don't think we need is support for mixing literals with values: ```python In("str_col", "a", literal("b")) # seems unnecessarily complicated In("str_col", "a", "b") # fine In("str_col", literal("a"), literal("b")) # also fine ``` -- 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