jorisvandenbossche opened a new issue, #51678: URL: https://github.com/apache/arrow/issues/51678
When converting a numpy array to pyarrow with a specified type, for certain cases we have a good error message, such as: ```python >>> pa.array(np.array([1, 2], dtype="int64"), pa.string()) .. ArrowTypeError: Expected a string or bytes dtype, got int64 >>> pa.array(np.array([1.5, 2.5], dtype="float64"), pa.int64()) .. ArrowInvalid: Float value 1.500000 was truncated converting to int64 ``` But some others have a less informative error: ```python >>> pa.array(np.array(["a", "b"], dtype="U"), pa.float64()) ... ArrowNotImplementedError: NumPy type not implemented: unrecognized type (19) in GetNumPyTypeName ``` (while the type is actually recognized, it converts fine without the type specifier) Triggered by https://github.com/apache/arrow/pull/51157#discussion_r4143193181, which adds a custom check to avoid such an error in case of the numpy StringDType, but this could use a more general solution (or expanded to other dtypes) -- 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]
