Repository navigation
Closed
Labels
Milestone
Description
Describe the bug, including details regarding any error messages, version, and platform.
Numpy has deprecated np.unicode_ and removed it in an upcoming 2.0 release. Current nightly builds do not have np.unicode_ which results in an incompatibility between pyarrow main and numpy main due to this mapping:
arrow/python/pyarrow/pandas_compat.py
Lines 87 to 102 in 13f0cd8
| _numpy_logical_type_map = { | |
| np.bool_: 'bool', | |
| np.int8: 'int8', | |
| np.int16: 'int16', | |
| np.int32: 'int32', | |
| np.int64: 'int64', | |
| np.uint8: 'uint8', | |
| np.uint16: 'uint16', | |
| np.uint32: 'uint32', | |
| np.uint64: 'uint64', | |
| np.float32: 'float32', | |
| np.float64: 'float64', | |
| 'datetime64[D]': 'date', | |
| np.unicode_: 'string', | |
| np.bytes_: 'bytes', | |
| } |
and possibly would also fail on this one
arrow/python/pyarrow/pandas_compat.py
Lines 1008 to 1018 in 13f0cd8
| _pandas_logical_type_map = { | |
| 'date': 'datetime64[D]', | |
| 'datetime': 'datetime64[ns]', | |
| 'datetimetz': 'datetime64[ns]', | |
| 'unicode': np.unicode_, | |
| 'bytes': np.bytes_, | |
| 'string': np.str_, | |
| 'integer': np.int64, | |
| 'floating': np.float64, | |
| 'empty': np.object_, | |
| } |
numpy now raises AttributeError: np.unicode_was removed in the NumPy 2.0 release. Usenp.str_ instead. See the full traceback in the geopandas CI.
Component(s)
Python
Reacted by Nirmal Nair
Activity
AlenkaF commentedon Sep 6, 2023
Thank you for bringing this to our attention @martinfleis !
[-]Compatibility with numpy 2.0 (removal of np.unicode_)[/-][+][Python] Compatibility with numpy 2.0 (removal of np.unicode_)[/+]graingert commentedon Oct 5, 2023
it looks like the nightly CI job is using https://pypi.anaconda.org/scipy-wheels-nightly/simple as opposed to https://pypi.anaconda.org/scientific-python-nightly-wheels/simple per https://scientific-python.org/specs/spec-0004/ so didn't get the nightly update to numpy v2
arrow/ci/scripts/install_pandas.sh
Line 31 in dd8734d
graingert commentedon Oct 5, 2023
There's a handful of other removals where pyarrow is impacted: np.sctypes and np.NaN
GH-37574: [Python] Compatibilty with numpy 2.0 (#38040)
apacheGH-37574: [Python] Compatibilty with numpy 2.0 (apache#38040)
apacheGH-37574: [Python] Compatibilty with numpy 2.0 (apache#38040)