sfc-gh-zpeng opened a new issue, #33763:
URL: https://github.com/apache/arrow/issues/33763

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   A map type can be created with the key and the item fields. And custom KV 
metadata can be attached to those fields. However, when creating such a type 
using pyarrow.map_(), the field level metadata are not taken. For example:
   
   ```
   map_type = pa.map_(
       pa.field("key", pa.string(), nullable=False, metadata={"abc": "1"}),
       pa.field("value", pa.int32(), metadata={"abc": "2"}))
   ```
   
   `map_type.key_field.metadata` is None, but it's expected to be `{"abc": 
"1"}`.
   
   I believe it's a bug in pyarrow. Specifically at this line: 
https://github.com/apache/arrow/blob/1d9366f19e4b9846b33cc0c7bd7941cb5f482d74/python/pyarrow/types.pxi#L2929
   
   A new field is created and used but without the metadata of the input field.
   
   Also see: 
https://colab.research.google.com/drive/1ixsRK02I0aItU9FlHQf14IArWwR5ugiA#scrollTo=mzkPfZ5h6Td6
   
   
   ### Component(s)
   
   Python


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

Reply via email to