pitrou commented on code in PR #37797:
URL: https://github.com/apache/arrow/pull/37797#discussion_r1345652003


##########
python/pyarrow/array.pxi:
##########
@@ -241,6 +246,13 @@ def array(object obj, type=None, mask=None, size=None, 
from_pandas=None,
 
     if hasattr(obj, '__arrow_array__'):
         return _handle_arrow_array_protocol(obj, type, mask, size)
+    elif hasattr(obj, '__arrow_c_array__'):
+        if type is not None:
+            requested_type = type.__arrow_c_schema__()

Review Comment:
   If this raises a `AttributeError`, we should perhaps catch it and raise a 
`TypeError` with a more descriptive error message? The average user would not 
know what a `__arrow_c_schema__` attribute implies.



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