forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lens] Add support for decimals in percentiles (elastic#165703)
## Summary Fixes elastic#98853 This PR adds support for decimals (2 digits) in percentile operation. ![percentile_decimals_support](https://github.com/elastic/kibana/assets/924948/cd0d2901-ba6f-452e-955c-f9d774a4e27f) Features: * ✨ Add decimals support in percentile * 🐛 Fixed aggs optimization to work with decimals * 💄 Show Toast for ranking reset when using decimals in both percentile and percentile rank * ✅ Extended `isValidNumber` to support digits check and added unit tests for it * ♻️ Added support also to `convert to Lens` feature Added both unit and functional tests. ![percentile_rank_toast](https://github.com/elastic/kibana/assets/924948/a9be1f9f-a1b1-4f9f-90dc-55e2af8933e1) When trying to add more digits than what is supported then it will show the input as invalid: <img width="347" alt="Screenshot 2023-09-05 at 12 24 03" src="https://github.com/elastic/kibana/assets/924948/3c38474f-b78f-4144-bca7-3dc192313c09"> Also it works now as custom ranking column: <img width="264" alt="Screenshot 2023-09-05 at 16 14 25" src="https://github.com/elastic/kibana/assets/924948/cb7be312-7f7b-4dc1-95a3-d893de344585"> <img width="264" alt="Screenshot 2023-09-05 at 16 14 20" src="https://github.com/elastic/kibana/assets/924948/1c13f66e-da78-4df6-bb4f-e811d47b66d5"> **Notes**: need to specify exact digits in percentile (2) because the `any` step is not supported and need to specify a number. I guess alternatives here are to either extend it to 4 digits or make it a configurable thing. ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Stratoula Kalafateli <[email protected]>
- Loading branch information
Showing
25 changed files
with
521 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.