Fokko commented on code in PR #8134:
URL: https://github.com/apache/iceberg/pull/8134#discussion_r1293092398


##########
python/pyiceberg/avro/reader.py:
##########
@@ -393,29 +373,33 @@ def __init__(self, element: Reader) -> None:
         self._hash = hash(self.element)
         self._is_int_list = isinstance(self.element, IntegerReader)
 
-    def read(self, decoder: BinaryDecoder) -> List[Any]:
+    def read(self, decoder: ReadableDecoder) -> List[Any]:
         read_items: List[Any] = []
         block_count = decoder.read_int()
         while block_count != 0:
             if block_count < 0:
                 block_count = -block_count
                 _ = decoder.read_int()
             if self._is_int_list:
-                decoder.read_ints(block_count, read_items)
+                read_items.extend(decoder.read_ints(block_count))
             else:
                 for _ in range(block_count):
                     read_items.append(self.element.read(decoder))
             block_count = decoder.read_int()
         return read_items
 
-    def skip(self, decoder: BinaryDecoder) -> None:
+    def skip(self, decoder: ReadableDecoder) -> None:
         _skip_map_array(decoder, lambda: self.element.skip(decoder))
 
     def __hash__(self) -> int:
         """Returns a hashed representation of the ListReader class."""
         return self._hash
 
 
+# Represent an empty dict as a singleton
+EMPTY_DICT: dict[Any, Any] = {}

Review Comment:
   Nit: We have an `EMPTY_DICT` in `typedef.py` that's frozen.



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