--- contrib/python/pyarrow/pyarrow/pandas_compat.py (index) +++ contrib/python/pyarrow/pyarrow/pandas_compat.py (working tree) @@ -30,6 +30,7 @@ import re import warnings import numpy as np +from numpy.core.numerictypes import sctypes as _np_sctypes import pyarrow as pa from pyarrow.lib import _pandas_api, builtin_pickle, frombytes # noqa @@ -97,7 +98,7 @@ _numpy_logical_type_map = { np.float32: 'float32', np.float64: 'float64', 'datetime64[D]': 'date', - np.unicode_: 'string', + np.str_: 'string', np.bytes_: 'bytes', } @@ -796,7 +797,7 @@ def table_to_blockmanager(options, table, categories=None, # dataframe (complex not included since not supported by Arrow) _pandas_supported_numpy_types = { str(np.dtype(typ)) - for typ in (np.sctypes['int'] + np.sctypes['uint'] + np.sctypes['float'] + + for typ in (_np_sctypes['int'] + _np_sctypes['uint'] + _np_sctypes['float'] + ['object', 'bool']) } @@ -1021,7 +1022,7 @@ def _is_generated_index_name(name): _pandas_logical_type_map = { 'date': 'datetime64[D]', 'datetime': 'datetime64[ns]', - 'unicode': np.unicode_, + 'unicode': np.str_, 'bytes': np.bytes_, 'string': np.str_, 'integer': np.int64,