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
vendor: Update json-iterator #6030
Conversation
c9bb021
to
50a34ce
Compare
web/api/v1/api.go
Outdated
stream.WriteFloat64(p.V) | ||
|
||
// Taken from https://github.com/json-iterator/go/blob/master/stream_float.go#L71 as a workaround | ||
// to https://github.com/json-it |
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.
Was this supposed to be a link to a GitHub issue? It looks truncated.
Could you elaborate on "Also add explicit support for NaN/Inf", how/where that's achieved? |
(just wondering because the last time I tried to update this json-iter, it resulted in NaN/Inf/-Inf causing marshaling errors, so I downgraded it again) |
Ah I guess that's just generally the manual |
Also add explicit support for NaN/Inf Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
50a34ce
to
f6c38aa
Compare
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
From my point of view it's to match prometheus/client_golang#570 However the jsoniter change was deliberate so the other choice would be to fork it? |
👍 |
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 if we have unit tests for that (:
@@ -1266,10 +1266,23 @@ func marshalPointJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) { | |||
} | |||
stream.WriteMore() | |||
stream.WriteRaw(`"`) | |||
stream.WriteFloat64(p.V) | |||
|
|||
// Taken from https://github.com/json-iterator/go/blob/master/stream_float.go#L71 as a workaround |
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.
Is this tested properly in api_test.go
?
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.
I find your lack of faith... disturbing:
prometheus/web/api/v1/api_test.go
Line 1705 in 76769d4
response: promql.Point{V: math.NaN(), T: 0}, |
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.
😢 I am too lazy
Also add explicit support for NaN/Inf
Signed-off-by: Goutham Veeramachaneni gouthamve@gmail.com