-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GH-35948: [Go] Only cast int8
and unit8
to float64
when JSON marshaling arrays
#35950
GH-35948: [Go] Only cast int8
and unit8
to float64
when JSON marshaling arrays
#35950
Conversation
int8
and unit8
to float64
when JSON marshaling arraysint8
and unit8
to float64
when JSON marshaling arrays
Not sure if the failing test is related to flaky, help appreciated |
@erezrokah The failing test is indeed a flaky test, I haven't yet been able to reproduce it locally in order to fix it which annoys me. But you're fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks much for this!
Thanks for the quick review and merge! |
Benchmark runs are scheduled for baseline = 105b9df and contender = 745fa94. 745fa94 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
…SON marshaling arrays (apache#35950) ### Rationale for this change See [issue](apache#35948). Based on https://github.com/apache/arrow/blob/9fb8697dcb442f63317c7d6046393fb74842e0ae/go/arrow/array/numeric.gen.go.tmpl#L120 it seems we should only do the casting for `unit8` and `int8` types. ### What changes are included in this PR? This PR fixes the numeric template so it only casts `int8` and `unit8` to `float64` when JSON marshaling arrays to avoid losing data for other types. ### Are these changes tested? Yes ### Are there any user-facing changes? The user facing change is that if a user was JSON marshaling arrays that has `uint64` or `int64` values they can now get different (more accurate) values than before * Closes: apache#35948 Authored-by: erezrokah <erezrokah@users.noreply.github.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com> (cherry picked from commit 745fa94)
Rationale for this change
See issue.
Based on
arrow/go/arrow/array/numeric.gen.go.tmpl
Line 120 in 9fb8697
unit8
andint8
types.What changes are included in this PR?
This PR fixes the numeric template so it only casts
int8
andunit8
tofloat64
when JSON marshaling arrays to avoid losing data for other types.Are these changes tested?
Yes
Are there any user-facing changes?
The user facing change is that if a user was JSON marshaling arrays that has
uint64
orint64
values they can now get different (more accurate) values than beforeint64
orunit64
arrays to JSON can cause loss of data #35948