rdblue commented on code in PR #8067:
URL: https://github.com/apache/iceberg/pull/8067#discussion_r1279680915


##########
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:
   Would a UUID ever produce a bytes object that isn't 16 bytes?



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