samredai commented on code in PR #4815:
URL: https://github.com/apache/iceberg/pull/4815#discussion_r878990780


##########
python/tests/expressions/test_expressions_base.py:
##########
@@ -84,6 +85,65 @@ def __str__(self):
         return "testexprb"
 
 
+class TestBooleanExpressionVisitor(base.BooleanExpressionVisitor[List]):
+    """A test implementation of a BooleanExpressionVisit
+
+    As this visitor visits each node, it appends an element to a 
`visit_histor` list. This enables testing that a given expression is
+    visited in an expected order by the `visit` method.
+    """
+
+    def __init__(self):
+        self.visit_history: List = []

Review Comment:
   Since we don't have predicates yet (coming in PR #4816), I added this 
test-only visitor. It's super simple and just appends a string for each visit 
method that gets called. I use this in the tests added to confirm that the 
visit methods are called in the expected post-order traversal of a given 
expression.



-- 
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]

Reply via email to