You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2023/01/06 17:15:39 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #6532: Python: Fix reading 0-bytes binary

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


##########
python/pyiceberg/avro/decoder.py:
##########
@@ -50,10 +50,10 @@ def read(self, n: int) -> bytes:
             raise ValueError(f"Requested {n} bytes to read, expected positive integer.")
         read_bytes = self._input_stream.read(n)
         read_len = len(read_bytes)
-        if read_len <= 0:
-            raise EOFError
+        if read_len < 0:
+            raise EOFError(f"Got negative length: {read_len}")

Review Comment:
   If I remember correctly, I think that this is how Python streams signal EOF. Now that we're using an Arrow stream, maybe that has changed?



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org