Fokko commented on code in PR #8067:
URL: https://github.com/apache/iceberg/pull/8067#discussion_r1279780482
##########
python/pyiceberg/avro/writer.py:
##########
@@ -78,22 +79,25 @@ def write(self, encoder: BinaryEncoder, val: float) -> None:
class DateWriter(Writer):
def write(self, encoder: BinaryEncoder, val: Any) -> None:
- encoder.write_date_int(val)
+ encoder.write_int(date_to_days(val))
Review Comment:
This is correct, right? The encoders only work with physical types. The
`write_date_int` accepted a `date`, and now we do the conversion in the writer
itself.
##########
python/pyiceberg/avro/writer.py:
##########
@@ -103,19 +107,18 @@ def write(self, encoder: BinaryEncoder, val: Any) -> None:
class UUIDWriter(Writer):
def write(self, encoder: BinaryEncoder, val: UUID) -> None:
- uuid_bytes = val.bytes
-
- if len(uuid_bytes) != 16:
- raise ValueError(f"Expected UUID to be 16 bytes, got:
{len(uuid_bytes)}")
-
- encoder.write_bytes_fixed(uuid_bytes)
+ if len(val.bytes) != 16:
+ raise ValueError(f"Expected UUID to be 16 bytes, got:
{len(val.bytes)}")
Review Comment:
I checked, and this isn't possible. Removed the check
--
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]