Copilot commented on code in PR #50203:
URL: https://github.com/apache/arrow/pull/50203#discussion_r3431336931


##########
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:
   `PyArray_NDIM(ndarray) != 1` will also treat 0-D ndarrays as eligible for 
the new fixed-size-list flattening path (since they get raveled to length 1). 
That’s a behavior change from the previous strict 1-D-only check and doesn’t 
seem intended by the rationale (which talks about ≥2-D). Consider continuing to 
reject 0-D ndarrays explicitly and only flatten when `ndim > 1`.



-- 
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]

Reply via email to