samredai commented on code in PR #4815: URL: https://github.com/apache/iceberg/pull/4815#discussion_r883878302
########## python/tests/expressions/test_expressions_base.py: ########## @@ -257,3 +317,111 @@ def test_bound_reference(table_schema_simple, foo_struct): assert bound_ref1.eval(foo_struct) == "foovalue" assert bound_ref2.eval(foo_struct) == 123 assert bound_ref3.eval(foo_struct) == True + + +def test_boolean_expression_visitor(): + """Test post-order traversal of boolean expression visit method""" + expr = base.And( + base.Or(base.Not(TestExpressionA()), base.Not(TestExpressionB()), TestExpressionA(), TestExpressionB()), + base.Not(TestExpressionA()), + TestExpressionB(), + ) + visitor = TestBooleanExpressionVisitor() + result = base.visit(expr, visitor=visitor) + assert result == [ + "TestExpressionA", + "NOT", + "TestExpressionB", + "NOT", + "OR", + "TestExpressionA", + "OR", + "TestExpressionB", + "OR", + "TestExpressionA", + "NOT", + "AND", + "TestExpressionB", + "AND", + ] + + +def test_or_with_always_true(): Review Comment: Removed 👍 -- 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