aboderinsamuel commented on code in PR #50203:
URL: https://github.com/apache/arrow/pull/50203#discussion_r3431424266
##########
python/pyarrow/src/arrow/python/python_to_arrow.cc:
##########
@@ -908,8 +908,20 @@ class PyListConverter : public ListConverter<T,
PyConverter, PyConverterTrait> {
Status AppendNdarray(PyObject* value) {
PyArrayObject* ndarray = reinterpret_cast<PyArrayObject*>(value);
+ OwnedRef flattened;
if (PyArray_NDIM(ndarray) != 1) {
Review Comment:
Good catch, fixed. The flatten path is now gated on PyArray_NDIM(ndarray) >=
2 (the check is if (PyArray_NDIM(ndarray) < 2 || ... != FIXED_SIZE_LIST) return
Invalid), so 0-D ndarrays keep raising Can only convert 1-dimensional array
values exactly as before, only genuinely multi-dimensional arrays are
flattened. Added a test asserting a 0-D element is rejected.
--
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]