Fokko commented on code in PR #6139:
URL: https://github.com/apache/iceberg/pull/6139#discussion_r1017626877
##########
python/tests/expressions/test_expressions.py:
##########
@@ -272,6 +235,22 @@ def test_in_empty():
assert In(Reference("foo"), ()) == AlwaysFalse()
+def test_in_set():
+ assert In(Reference("foo"), {"a", "bc", "def"}).literals ==
{StringLiteral("a"), StringLiteral("bc"), StringLiteral("def")}
+
+
+def test_in_sets():
+ assert In(Reference("foo"), {"a"}, {"bc", "def"}).literals ==
{StringLiteral("a"), StringLiteral("bc"), StringLiteral("def")}
Review Comment:
Since we don't support a set literal, I figured this would be okay:
```python
➜ iceberg git:(fd-remove-dataclass) ✗ python3
Python 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0
(clang-1400.0.29.102)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyiceberg.expressions.literals import literal
>>> literal({1,2,3})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/functools.py",
line 889, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
File
"/Users/fokkodriesprong/Desktop/iceberg/python/pyiceberg/expressions/literals.py",
line 124, in literal
raise TypeError(f"Invalid literal value: {repr(value)}")
TypeError: Invalid literal value: {1, 2, 3}
```
--
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]