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


##########
python/pyarrow/tests/test_array.py:
##########
@@ -2924,6 +2924,24 @@ def test_array_from_invalid_dim_raises():
         pa.array(arr0d)
 
 
[email protected]
+def test_fixed_size_list_from_multidim_ndarray():
+    # GH-49644: a fixed-size list can be built from multi-dimensional ndarray
+    # elements by flattening them in C order.
+    arr = pa.array([np.array([[1, 2, 3]]), np.array([[4, 5, 6]])],
+                   type=pa.list_(pa.int64(), 3))
+    assert arr.type == pa.list_(pa.int64(), 3)
+    assert arr.to_pylist() == [[1, 2, 3], [4, 5, 6]]

Review Comment:
   Added a (2, 2) → fixed_size_list(int64, 4) case asserting the result is [[1, 
2, 3, 4]], which confirms C-order (row-major) flattening rather than just a 
trivial single-row reshape.



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