verma-kartik commented on code in PR #41109:
URL: https://github.com/apache/arrow/pull/41109#discussion_r1559862584
##########
go/arrow/array/float16.go:
##########
@@ -87,10 +87,16 @@ func (a *Float16) GetOneForMarshal(i int) interface{} {
func (a *Float16) MarshalJSON() ([]byte, error) {
vals := make([]interface{}, a.Len())
for i, v := range a.values {
- if a.IsValid(i) {
- vals[i] = v.Float32()
- } else {
+ if !a.IsValid(i) {
vals[i] = nil
+ continue
+ }
+
+ switch {
+ case v.IsNaN():
+ vals[i] = "NaN"
+ default:
+ vals[i] = v.Float32()
}
Review Comment:
Yeah. I had a doubt in this. If I use float16.Inf(), I assume that is
"+Inf". What for "-Inf" then?
--
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]