You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Prem Sagar Gali (Jira)" <ji...@apache.org> on 2021/08/25 23:38:00 UTC

[jira] [Created] (ARROW-13762) Unable to cast `HalffloatArray` to `Float` or `Double`

Prem Sagar Gali created ARROW-13762:
---------------------------------------

             Summary: Unable to cast `HalffloatArray` to `Float` or `Double`
                 Key: ARROW-13762
                 URL: https://issues.apache.org/jira/browse/ARROW-13762
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
    Affects Versions: 5.0.0, 5.0.1
            Reporter: Prem Sagar Gali


I'm not able to cast the `float16` type to `float32`/`float64`, here is a repro:
{code:java}
>>> import pyarrow as pa
>>> import numpy as np
>>> pa.array(np.array([1, 2.0], dtype='float32')).cast(pa.float64())
<pyarrow.lib.DoubleArray object at 0x7fa67cc56760>
[
  1,
  2
]
>>> pa.array(np.array([1, 2.0], dtype='float16')).cast(pa.float64())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyarrow/array.pxi", line 816, in pyarrow.lib.Array.cast
  File "/home/pgali/anaconda3/envs/cudf_dev/lib/python3.8/site-packages/pyarrow/compute.py", line 297, in cast
    return call_function("cast", [arr], options)
  File "pyarrow/_compute.pyx", line 527, in pyarrow._compute.call_function
  File "pyarrow/_compute.pyx", line 337, in pyarrow._compute.Function.call
  File "pyarrow/error.pxi", line 143, in pyarrow.lib.pyarrow_internal_check_status
  File "pyarrow/error.pxi", line 120, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Unsupported cast from halffloat to double using function cast_double
>>> 
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)