rdblue commented on code in PR #6997:
URL: https://github.com/apache/iceberg/pull/6997#discussion_r1168050097
##########
python/pyiceberg/io/pyarrow.py:
##########
@@ -358,14 +368,17 @@ def field(self, field: NestedField, field_result:
pa.DataType) -> pa.Field:
name=field.name,
type=field_result,
nullable=field.optional,
- metadata={"doc": field.doc, "id": str(field.field_id)} if
field.doc else {},
+ metadata={FIELD_DOC: field.doc, FIELD_ID: str(field.field_id)} if
field.doc else {FIELD_ID: str(field.field_id)},
)
- def list(self, _: ListType, element_result: pa.DataType) -> pa.DataType:
- return pa.list_(value_type=element_result)
+ def list(self, list_type: ListType, element_result: pa.DataType) ->
pa.DataType:
+ element_field = self.field(list_type.element_field, element_result)
+ return pa.list_(value_type=element_field)
Review Comment:
`list_` appears to accept `DataType | Field` but it doesn't look like `map_`
does the same. When I inspect the method it expects `DataType` for both
`key_type` and `value_type`. Is there a test that this is doing what we expect?
--
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]