rdblue commented on code in PR #6128:
URL: https://github.com/apache/iceberg/pull/6128#discussion_r1022174272


##########
python/tests/test_transforms.py:
##########
@@ -506,3 +532,345 @@ def test_datetime_transform_str(transform, transform_str):
 )
 def test_datetime_transform_repr(transform, transform_repr):
     assert repr(transform) == transform_repr
+
+
[email protected]
+def bound_reference_str() -> BoundReference:
+    return BoundReference(field=NestedField(1, "field", StringType(), 
required=False), accessor=Accessor(position=0, inner=None))
+
+
[email protected]
+def bound_reference_date() -> BoundReference:
+    return BoundReference(field=NestedField(1, "field", DateType(), 
required=False), accessor=Accessor(position=0, inner=None))
+
+
[email protected]
+def bound_reference_timestamp() -> BoundReference:
+    return BoundReference(
+        field=NestedField(1, "field", TimestampType(), required=False), 
accessor=Accessor(position=0, inner=None)
+    )
+
+
[email protected]
+def bound_reference_decimal() -> BoundReference:
+    return BoundReference(
+        field=NestedField(1, "field", DecimalType(8, 2), required=False), 
accessor=Accessor(position=0, inner=None)
+    )
+
+
[email protected]
+def bound_reference_long() -> BoundReference:
+    return BoundReference(
+        field=NestedField(1, "field", DecimalType(8, 2), required=False), 
accessor=Accessor(position=0, inner=None)
+    )
+
+
+def test_projection_bucket_unary(bound_reference_str: BoundReference) -> None:
+    assert BucketTransform(2).project("name", 
BoundNotNull(term=bound_reference_str)) == NotNull(term=Reference(name="name"))
+
+
+def test_projection_bucket_literal(bound_reference_str: BoundReference) -> 
None:

Review Comment:
   It would be fine to add these when the projection visitor is added, so that 
the thorough tests cover other boolean expressions (and/or/not) as well as the 
handling when a transform projection returns `None`.
   
   I think that's also how we test the Java implementation.



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