Fokko commented on code in PR #8067:
URL: https://github.com/apache/iceberg/pull/8067#discussion_r1280325470
##########
python/tests/avro/test_encoder.py:
##########
@@ -156,52 +148,24 @@ def test_write_utf8() -> None:
assert output.getbuffer() == b"".join([b"\x7a", bin_input])
-def test_write_date_int() -> None:
- output = io.BytesIO()
- encoder = BinaryEncoder(output)
-
- _input = datetime.date(1970, 1, 2)
- encoder.write_date_int(_input)
-
- assert output.getbuffer() == b"\x02"
-
-
-def test_write_time_millis_int() -> None:
- output = io.BytesIO()
- encoder = BinaryEncoder(output)
-
- _input = datetime.time(1, 2, 3, 456000)
- encoder.write_time_millis_int(_input)
-
- assert output.getbuffer() == b"\x80\xc3\xc6\x03"
-
-
def test_write_time_micros_long() -> None:
output = io.BytesIO()
encoder = BinaryEncoder(output)
_input = datetime.time(1, 2, 3, 456000)
- encoder.write_time_micros_long(_input)
+ encoder.write_time_micros(_input)
assert output.getbuffer() == b"\x80\xb8\xfb\xde\x1b"
-def test_write_timestamp_millis_long() -> None:
- output = io.BytesIO()
- encoder = BinaryEncoder(output)
-
- _input = datetime.datetime(2023, 1, 1, 1, 2, 3)
- encoder.write_timestamp_millis_long(_input)
-
- assert output.getbuffer() == b"\xf0\xdb\xcc\xad\xad\x61"
-
-
-def test_write_timestamp_micros_long() -> None:
+def test_write_uuid() -> None:
output = io.BytesIO()
encoder = BinaryEncoder(output)
- _input = datetime.datetime(2023, 1, 1, 1, 2, 3)
- encoder.write_timestamp_micros_long(_input)
+ _input = uuid.UUID("{12345678-1234-5678-1234-567812345678}")
Review Comment:
Yes, it is in the examples, but actually not required:
```python
>>> import uuid
>>> uuid.UUID("{12345678-1234-5678-1234-567812345678}")
UUID('12345678-1234-5678-1234-567812345678')
>>> uuid.UUID("12345678-1234-5678-1234-567812345678")
UUID('12345678-1234-5678-1234-567812345678')
```
```suggestion
_input = uuid.UUID("{12345678-1234-5678-1234-567812345678}")
```
--
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]