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

   Yes, this is just not implemented, but therefore very confusing. You can see 
through other means that the actual stored values are fine:
   
   ```python
   >>> arr = pyarrow.array([numpy.float16(1)], type=pyarrow.float16())
   >>> arr[0]
   <pyarrow.HalfFloatScalar: 1.0>
   >>> arr.to_numpy()
   array([1.], dtype=float16)
   ```
   
   In general, float16 has only limited support in pyarrow. For example also 
casting to other types is not yet implemented 
(https://github.com/apache/arrow/issues/32802 (casting to strings), 
https://github.com/apache/arrow/issues/20213)
   
   Specifically for the `repr`, this is using the PrettyPrinter defined in 
Arrow C++, and actually have a note about the float16 support in its 
implementation:
   
   
https://github.com/apache/arrow/blob/f9904063b163c4ad44bef61e84a1e4a90b600d34/cpp/src/arrow/pretty_print.cc#L223-L227
   
   So we explicitly fallback to printing it as int16 because float16 is not 
easy to do (so you get the same output as what you would get when doing 
`.view(np.int16)` in numpy)


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