0x26res opened a new issue, #36809:
URL: https://github.com/apache/arrow/issues/36809

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   It is possible to customize the name of the value field for `pa.MapType`. I 
believe it's a niche feature used for compatibility with parquet and it doesn't 
change the semantic of the map type. 
   
   this feature causes a KeyError in `MapScalar.as_py`:
   
   ```
   def test_bug_in_pyarrow():
       assert pa.scalar(
           [("foo", "bar")],
           pa.map_(
               pa.string(),
               pa.field("value", pa.string()),
           ),
       ).as_py() == [("foo", "bar")]
   
       with pytest.raises(KeyError, match=r"value"):
           pa.scalar(
               [("foo", "bar")],
               pa.map_(
                   pa.string(),
                   pa.field("map_value", pa.string()),
               ),
           ).as_py()
   
   ```
   
   ### 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