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



##########
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 think the problem of doing it that way is that you end up using 
equality to build the test cases for inequality. So by filtering the list 
you're testing that objects are unequal if they were not filtered because they 
were equal.




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