-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Properly read new percentile agg format #6309
Conversation
03d8ac9
to
a4afa37
Compare
}) / 100; | ||
const values = bucket[agg.parentId] && bucket[agg.parentId].values; | ||
const percentile = _.find(values, value => agg.key === value.key); | ||
return percentile ? percentile.value / 100 : null; |
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.
The existing behavior would always return a number, can you think of any circumstances where returning null
would cause issues?
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 can't, but I suppose NaN is as good a default as any in this scenario.
Confirmed that #6228 fixes the fatal error issue. |
We should get tests for some of this, but since this bug is currently blocking green builds on valid PRs, let's get this through. LGTM |
Properly read new percentile agg format
Looks like the format change was a but in Elasticsearch and was recently fixed: elastic/elasticsearch#17217 Do we still need this change in v5.0.0 then? |
@tbragin that bug was about the default format, we want to use the new format because it gives us actual numbers, not strings that we parse into numbers |
* Test utils * Test get_configure * Test post_configure * Test get_connectors * Test patch_configure * Improve test * Fixes Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Built on top of #6308, which is required for the tests to pass.
Sometime recently the percentile aggregation's response format is changed from:
to