HonahX commented on code in PR #458: URL: https://github.com/apache/iceberg-python/pull/458#discussion_r1496752910
########## pyiceberg/io/pyarrow.py: ########## @@ -689,15 +689,28 @@ def _(obj: pa.StructType, visitor: PyArrowSchemaVisitor[T]) -> T: return visitor.struct(obj, results) -@visit_pyarrow.register(pa.ListType) -def _(obj: pa.ListType, visitor: PyArrowSchemaVisitor[T]) -> T: +def process_list_type(obj: Union[pa.ListType, pa.LargeListType, pa.FixedSizeListType], visitor: PyArrowSchemaVisitor[T]) -> T: visitor.before_list_element(obj.value_field) result = visit_pyarrow(obj.value_type, visitor) visitor.after_list_element(obj.value_field) - return visitor.list(obj, result) +@visit_pyarrow.register(pa.ListType) Review Comment: Hi @hussein-awala. I think we can do: ```python @visit_pyarrow.register(pa.ListType) @visit_pyarrow.register(pa.LargeListType) @visit_pyarrow.register(pa.FixedSizeListType) def _(obj: Union[pa.ListType, pa.LargeListType, pa.FixedSizeListType], visitor: PyArrowSchemaVisitor[T]) -> T: visitor.before_list_element(obj.value_field) result = visit_pyarrow(obj.value_type, visitor) visitor.after_list_element(obj.value_field) return visitor.list(obj, result) ``` I checked locally and MyPy did not complain. WDYT? -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org