arw2019 commented on a change in pull request #8044:
URL: https://github.com/apache/arrow/pull/8044#discussion_r476648698



##########
File path: python/pyarrow/tests/test_convert_builtin.py
##########
@@ -382,11 +382,8 @@ def test_sequence_custom_integers(seq):
 @parametrize_with_iterable_types
 def test_broken_integers(seq):

Review comment:
       We lose the the more specific traceback and `ZeroDivisionError` message, 
in favor of
   ``` python
   In [11]: class MyBrokenInt: 
       ...:     def __init__(self): 
       ...:         1/0
   In [12]: pa.array([MyBrokenInt()], type=pa.int64())        
   ---------------------------------------------------------------------------
   ArrowInvalid                              Traceback (most recent call last)
   <ipython-input-12-1cf156b165b3> in <module>
   ----> 1 pa.array([MyBrokenInt()], type=pa.int64())
   
   ~/git_repo/arrow/python/pyarrow/array.pxi in pyarrow.lib.array()
       269     else:
       270         # ConvertPySequence does strict conversion if type is 
explicitly passed
   --> 271         return _sequence_to_array(obj, mask, size, type, pool, 
c_from_pandas)
       272 
       273 
   
   ~/git_repo/arrow/python/pyarrow/array.pxi in pyarrow.lib._sequence_to_array()
        38 
        39     with nogil:
   ---> 40         check_status(ConvertPySequence(sequence, mask, options, 
&out))
        41 
        42     if out.get().num_chunks() == 1:
   
   ~/git_repo/arrow/python/pyarrow/error.pxi in pyarrow.lib.check_status()
        82 
        83         if status.IsInvalid():
   ---> 84             raise ArrowInvalid(message)
        85         elif status.IsIOError():
        86             # Note: OSError constructor is
   ArrowInvalid: Could not convert <__main__.MyBrokenInt object at 
0x7fc331394290> with type MyBrokenInt: tried to convert to int
   ```
   but this is the same message as what we get on master for 
   ``` python
   In [11]: class MyBrokenInt: 
       ...:     def __init__(self): 
       ...:         1/1 
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to