cccs-eric commented on a change in pull request #3988:
URL: https://github.com/apache/iceberg/pull/3988#discussion_r801990105



##########
File path: python_legacy/tests/api/test_conversions.py
##########
@@ -79,3 +87,9 @@ def test_to_bytes(self):
                          
Literal.of(uuid.UUID("f79c3e09-677c-4bbd-a479-3f349cb785e7")).to_byte_buffer())
         self.assertEqual(b'foo', Literal.of(bytes(b'foo')).to_byte_buffer())
         self.assertEqual(b'foo', 
Literal.of(bytearray(b'foo')).to_byte_buffer())
+        # Decimal on 2-bytes
+        self.assertEqual(b'\x30\x39', Literal.of(123.45).to(DecimalType.of(5, 
2)).to_byte_buffer())
+        # Decimal on 3-bytes to test that we use the minimum number of bytes
+        self.assertEqual(b'\x12\xd6\x87', 
Literal.of(123.4567).to(DecimalType.of(7, 4)).to_byte_buffer())
+        # Negative decimal to test two's complement
+        self.assertEqual(b'\xed\x29\x79', 
Literal.of(-123.4567).to(DecimalType.of(7, 4)).to_byte_buffer())

Review comment:
       Yes, I added 3 tests to the Java implementation that I felt were not 
covered by the Java test suite.  If it's what you are talking about...




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