rdblue commented on code in PR #4816:
URL: https://github.com/apache/iceberg/pull/4816#discussion_r907946909
##########
python/tests/expressions/test_expressions_base.py:
##########
@@ -191,29 +198,38 @@ def test_strs(op, string):
(base.Not(TestExpressionA()), base.Not(TestExpressionA()),
TestExpressionB()),
(TestExpressionA(), TestExpressionA(), TestExpressionB()),
(TestExpressionB(), TestExpressionB(), TestExpressionA()),
+ (
+ base.In(base.UnboundReference("foo"), [literal("hello"),
literal("world")]),
+ base.In(base.UnboundReference("foo"), [literal("hello"),
literal("world")]),
+ base.In(base.UnboundReference("not_foo"), [literal("hello"),
literal("world")]),
+ ),
+ (
+ base.In(base.UnboundReference("foo"), [literal("hello"),
literal("world")]),
+ base.In(base.UnboundReference("foo"), [literal("hello"),
literal("world")]),
+ base.In(base.UnboundReference("foo"), [literal("goodbye"),
literal("world")]),
+ ),
],
)
def test_eq(exp, testexpra, testexprb):
assert exp == testexpra and exp != testexprb
@pytest.mark.parametrize(
- "lhs, rhs",
+ "lhs, rhs, raises",
[
- (
- base.And(TestExpressionA(), TestExpressionB()),
- base.Or(TestExpressionB(), TestExpressionA()),
- ),
- (
- base.Or(TestExpressionA(), TestExpressionB()),
- base.And(TestExpressionB(), TestExpressionA()),
- ),
- (base.Not(TestExpressionA()), TestExpressionA()),
- (TestExpressionA(), TestExpressionB()),
+ (base.And(TestExpressionA(), TestExpressionB()),
base.Or(TestExpressionB(), TestExpressionA()), False),
+ (base.Or(TestExpressionA(), TestExpressionB()),
base.And(TestExpressionB(), TestExpressionA()), False),
+ (base.Not(TestExpressionA()), TestExpressionA(), False),
+ (base.In(base.UnboundReference("foo"), [literal("hello"),
literal("world")]), None, True),
+ (TestExpressionA(), TestExpressionB(), False),
],
)
-def test_negate(lhs, rhs):
- assert ~lhs == rhs
+def test_negate(lhs, rhs, raises):
+ if not raises:
Review Comment:
It may be a good idea to go ahead and add `NotIn` so you don't waste time
writing tests for temporary behavior.
--
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]