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 2022/05/19 15:38:15 UTC

[GitHub] [arrow] jorisvandenbossche commented on issue #12652: [Python] How to avoid overflow error.

jorisvandenbossche commented on issue #12652:
URL: https://github.com/apache/arrow/issues/12652#issuecomment-1131883357

   Indeed it seems the `safe` keyword is ignored _if_ we are using the python_to_arrow.cc code path (in contrast to the numpy_to_arrow.cc code path). This is similar as a recent issue that was opened with a variant on this (using list arrays): https://issues.apache.org/jira/browse/ARROW-16491
   
   A simplified example (even without using a nested type):
   
   ```
   # input is a python list -> safe keyword doesn't work
   >>> pa.array([3046682132], pa.int32(), safe=False)
   ...
   ArrowInvalid: Value 3046682132 too large to fit in C integer type
   
   # input is a numpy array -> safe=False has effect
   >>> pa.array(np.array([3046682132]), pa.int32(), safe=False)
   <pyarrow.lib.Int32Array object at 0x7f40e939f040>
   [
     -1248285164
   ]
   ```
   
   So going to close this, and add the example at https://issues.apache.org/jira/browse/ARROW-16491


-- 
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: github-unsubscribe@arrow.apache.org

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