AlenkaF commented on issue #45875: URL: https://github.com/apache/arrow/issues/45875#issuecomment-2771606180
Thank you for opening the issue, @bmschmidt! Unfortunately, this is a known bug. We've created an umbrella issue that tracks all cases related to the Python to PyArrow array conversion where `safe=False` is ignored. You can follow the progress of this bug here: https://github.com/apache/arrow/issues/36202. The issue arises because the code path for the Python to PyArrow conversion does not implement the different notions of `safe=True` vs `safe=False`. If you would start with a NumPy array, which uses a different code path (numpy_to_arrow.cc ), the above behaviour would match: ```python In [10]: pa.array(np.array([99999999]), pa.float32(), safe=False) Out[10]: <pyarrow.lib.FloatArray object at 0x10c074ca0> [ 100000000 ] ``` To fix this, the code in python_to_arrow.cc will need to be updated to use the Arrow C++ casting machinery, including the correct handling of safe. I’ll be closing this issue in favour of the one linked above (https://github.com/apache/arrow/issues/36202), but please don’t hesitate to ask any additional questions or add comments there! -- 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]
