AlenkaF commented on code in PR #34658:
URL: https://github.com/apache/arrow/pull/34658#discussion_r1172823110


##########
python/pyarrow/array.pxi:
##########
@@ -318,11 +318,29 @@ def array(object obj, type=None, mask=None, size=None, 
from_pandas=None,
             if pandas_api.have_pandas:
                 values, type = pandas_api.compat.get_datetimetz_type(
                     values, obj.dtype, type)
-            result = _ndarray_to_array(values, mask, type, c_from_pandas, safe,
-                                       pool)
+            try:
+                result = _ndarray_to_array(values, mask, type, c_from_pandas, 
safe,
+                                           pool)
+            except ArrowInvalid as err:
+                if "Scalar" in str(err):

Review Comment:
   Oh yeah, it's very hacky! =)
   I have tried multiple ways of catching the specific `ArrowInvalid` error as 
others are expected here also, but all of them have some issue. Can try to 
remember them all and list them, but Joris advised me to go into the Python C++ 
code and use `ConvertToSequenceAndInferSize` so this will be changed. I should 
convert this PR into a draft to make this clear.
   
   Thank you for reviewing!



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