zeroshade commented on a change in pull request #11359:
URL: https://github.com/apache/arrow/pull/11359#discussion_r744294944
##########
File path: go/arrow/array/float16_builder.go
##########
@@ -163,3 +168,59 @@ func (b *Float16Builder) newData() (data *Data) {
return
}
+
+func (b *Float16Builder) unmarshalOne(dec *json.Decoder) error {
+ t, err := dec.Token()
+ if err != nil {
+ return err
+ }
+
+ switch v := t.(type) {
+ case float64:
+ b.Append(float16.New(float32(v)))
+ case string:
+ f, err := strconv.ParseFloat(v, 32)
+ if err != nil {
+ return err
+ }
+ b.Append(float16.New(float32(f)))
Review comment:
It's in the docstring for the `UnmarshalJSON` function which means it'll
appear in the public docs for the `UnmarshalJSON` on `Float16Builder`
--
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]