Fokko commented on code in PR #6139:
URL: https://github.com/apache/iceberg/pull/6139#discussion_r1017645513
##########
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")}
+
+
+def test_in_positional_args():
+ assert In(Reference("foo"), "a", "bc", "def").literals ==
{StringLiteral("a"), StringLiteral("bc"), StringLiteral("def")}
+
+
+def test_in_string_and_set():
+ assert In(Reference("foo"), "a", {"bc", "def"}).literals ==
{StringLiteral("a"), StringLiteral("bc"), StringLiteral("def")}
Review Comment:
Made them less friendly:
```python
def test_in_sets():
with pytest.raises(TypeError) as exc_info:
assert In(Reference("foo"), {"a"}, {"bc", "def"}).literals == {
StringLiteral("a"),
StringLiteral("bc"),
StringLiteral("def"),
}
assert str(exc_info.value) == "Invalid literal value: {'a'}"
def test_in_string_and_set():
with pytest.raises(TypeError) as exc_info:
assert In(Reference("foo"), "a", {"bc", "def"}).literals == {
StringLiteral("a"),
StringLiteral("bc"),
StringLiteral("def"),
}
assert str(exc_info.value) == "Invalid literal value: {'bc', '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: [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]