emkornfield commented on a change in pull request #3965:
URL: https://github.com/apache/iceberg/pull/3965#discussion_r793244485



##########
File path: python/tests/test_types.py
##########
@@ -161,3 +187,25 @@ def test_nested_field():
     assert field_var.field_id == 1
     assert isinstance(field_var.type, StructType)
     assert str(field_var) == str(eval(repr(field_var)))
+
+
[email protected](
+    "input_type,equal_object,not_equal_object",
+    [
+        (BooleanType, BooleanType(), IntegerType()),
+        (IntegerType, IntegerType(), BooleanType()),
+        (LongType, LongType(), DoubleType()),
+        (FloatType, FloatType(), IntegerType()),
+        (DoubleType, DoubleType(), FloatType()),
+        (DateType, DateType(), TimeType()),
+        (TimeType, TimeType(), TimestampType()),
+        (TimestampType, TimestampType(), TimestamptzType()),
+        (TimestamptzType, TimestamptzType(), TimestampType()),
+        (StringType, StringType(), UUIDType()),
+        (UUIDType, UUIDType(), StringType()),
+        (BinaryType, BinaryType(), FixedType(6)),
+    ],
+)
+def test_primitive_equality(input_type, equal_object, not_equal_object):
+    assert equal_object == input_type()
+    assert not_equal_object != input_type()

Review comment:
       I doubt this will change much but for the negative case you can use a 
[product](https://docs.python.org/3/library/itertools.html#itertools.product) 
and filter out objects of the same type to do an exhaustive test.




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