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



##########
File path: python/pyarrow/_compute.pyx
##########
@@ -416,7 +416,8 @@ cdef class MetaFunction(Function):
 
 cdef _pack_compute_args(object values, vector[CDatum]* out):
     for val in values:
-        if isinstance(val, (list, np.ndarray)):
+        if isinstance(val, (list, np.ndarray)) or \
+                hasattr(val, '__arrow_array__'):

Review comment:
       If we are adding this specific check, should we maybe also add a 
`hasattr(val, "__array__")` for also including "numpy-array-likes"? 
   
   (although that can maybe also decided in a separate JIRA)
   
   It's just that the current set of types we try to convert to an array is 
somewhat arbitrary. List and np.ndarray are of course the logical things to 
support. But the current check would mean that, for example, a pd.Series or a 
generic sequence are not accepted (while `asarray` will accept those)




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