You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/18 21:54:41 UTC

[GitHub] [iceberg] samredai commented on a diff in pull request #5303: Add a BoundBooleanExpressionVisitor for visiting bound expressions

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


##########
python/tests/expressions/test_expressions_base.py:
##########
@@ -634,3 +651,16 @@ def test_not_expression_binding(unbound_not_expression, expected_bound_expressio
     """Test that visiting an unbound NOT expression with a bind-visitor returns the expected bound expression"""
     bound_expression = base.visit(unbound_not_expression, visitor=base.BindVisitor(schema=table_schema_simple))
     assert bound_expression == expected_bound_expression
+
+
+def test_bound_boolean_expression_visitor():
+    bound_expression = base.BoundIn[str](
+        term=base.BoundReference(
+            field=NestedField(field_id=1, name="foo", field_type=StringType(), required=False),
+            accessor=Accessor(position=0, inner=None),
+        ),
+        literals=(StringLiteral("foo"), StringLiteral("bar")),
+    )
+    visitor = FooBoundBooleanExpressionVisitor()
+    result = base.visit(bound_expression, visitor=visitor)
+    assert result == ["IN"]

Review Comment:
   Just a simple test here for now using the test implementation `FooBoundBooleanExpressionVisitor`. Once more predicates are added we include more robust tests.



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org