From bbd1f92aa297ae26f6b3ca71e4b1cb22bc7830e4 Mon Sep 17 00:00:00 2001 From: Derek Marsh Date: Fri, 9 Oct 2020 23:01:24 -0500 Subject: [PATCH 1/2] ARROW-10260 [Python] Missing MapType to Pandas dtype --- python/pyarrow/types.pxi | 1 + 1 file changed, 1 insertion(+) diff --git a/python/pyarrow/types.pxi b/python/pyarrow/types.pxi index 76a35aa797e..19d00ac33e4 100644 --- a/python/pyarrow/types.pxi +++ b/python/pyarrow/types.pxi @@ -47,6 +47,7 @@ cdef dict _pandas_type_map = { _Type_STRING: np.object_, _Type_LIST: np.object_, _Type_DECIMAL: np.object_, + _Type_MAP: np.object_, } cdef dict _pep3118_type_map = { From 8a2655be2106aca687162319318196a14827e28c Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Sat, 10 Oct 2020 10:27:55 +0200 Subject: [PATCH 2/2] add test --- python/pyarrow/tests/test_schema.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/pyarrow/tests/test_schema.py b/python/pyarrow/tests/test_schema.py index 032793a3041..3ba9b7bbe4c 100644 --- a/python/pyarrow/tests/test_schema.py +++ b/python/pyarrow/tests/test_schema.py @@ -70,6 +70,7 @@ def test_type_to_pandas_dtype(): (pa.string(), np.object_), (pa.list_(pa.int8()), np.object_), # (pa.list_(pa.int8(), 2), np.object_), # TODO needs pandas conversion + (pa.map_(pa.int64(), pa.float64()), np.object_), ] for arrow_type, numpy_type in cases: assert arrow_type.to_pandas_dtype() == numpy_type