You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/11/07 20:28:04 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #6139: Python: Remove dataclasses

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


##########
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:
   Do we need values to be so complex? I would say that we can accept any `Iterable[T]` or `Iterable[Literal[T]]`. We don't need to support mixing literals with raw values, 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: issues-unsubscribe@iceberg.apache.org

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


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