You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/20 14:25:15 UTC

[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #10097: ARROW-11780: [Python] Avoid crashing when a ChunkedArray is provided to StructArray.from_arrays()

jorisvandenbossche commented on a change in pull request #10097:
URL: https://github.com/apache/arrow/pull/10097#discussion_r616735327



##########
File path: python/pyarrow/array.pxi
##########
@@ -2178,7 +2178,10 @@ cdef class StructArray(Array):
 
         arrays = [asarray(x) for x in arrays]
         for arr in arrays:
-            c_arrays.push_back(pyarrow_unwrap_array(arr))
+            c_array = pyarrow_unwrap_array(arr)
+            if c_array == nullptr:
+                raise TypeError(f"Unsupported array type {arr.__class__}")

Review comment:
       To improve this error message, maybe it can something like "Expected Array, got {..} instead) ?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org