-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++][Python] Support pretty printing of float16 #36753
Comments
Yes, this is just not implemented, but therefore very confusing. You can see through other means that the actual stored values are fine: >>> 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 (#32802 (casting to strings), #20213) Specifically for the arrow/cpp/src/arrow/pretty_print.cc Lines 223 to 227 in f990406
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 |
Some recent discussion about float16 support: #22806 |
To me personally, if not trivial to visualize the right value, it'd make more sense to fallback to something like |
@benibus FYI |
We should revive this now that we do have a half-float library available. |
Comment where I'm promising a fix: |
Describe the bug, including details regarding any error messages, version, and platform.
Seems like the representation of float16 values is wrong:
Instead of showing
1.
as the value, an integer12360
is shown.Tried with pyarrow 12.0.0.
Component(s)
Python
Related:
The text was updated successfully, but these errors were encountered: