Commit b7c0e07
# Backport
This will backport the following commits from `main` to `8.x`:
- [[ES|QL] [Discover] Displays the histogram suggestion always for non
transformational commands
(#195863)](#195863)
<!--- Backport version: 9.4.3 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2024-10-14T09:52:16Z","message":"[ES|QL]
[Discover] Displays the histogram suggestion always for non
transformational commands (#195863)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195752\r\n\r\nThis PR is fixing
2 bugs:\r\n\r\n- It filters out counter fields from the breakdown as
they are not\r\nsupported. I created a new util for this\r\n- Fixes a
bug unrelated with the breakdown (it also exists in previous\r\nminors).
The LensVis service is computing suggestions and pushes them
to\r\n`availableSuggestionsWithType `. In some indexes (it depends on
the\r\ntypes of the first 5 columns of the index) the lens suggestions
api\r\nmight return a suggestion. So in that case the array has the
histogram\r\nsuggestion + the suggestion from the suggestions api. So
the service\r\nwill pick the first one which is not the histogram. But
we know that in\r\ncase of non transformational commands we want to
suggest the histogram.\r\nSo this PR is fixing it by ensuring that the
array is cleaned up before\r\npushing the histogram
suggestion.\r\n\r\n\r\nNote: The 2 bugs are unrelated I just decided to
fix them in one PR as\r\nthey are both histogram bugs.\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"f962cdcd796af9908449155c989dd03438165773","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor","Feature:ES|QL"],"title":"[ES|QL]
[Discover] Displays the histogram suggestion always for non
transformational
commands","number":195863,"url":"https://github.com/elastic/kibana/pull/195863","mergeCommit":{"message":"[ES|QL]
[Discover] Displays the histogram suggestion always for non
transformational commands (#195863)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195752\r\n\r\nThis PR is fixing
2 bugs:\r\n\r\n- It filters out counter fields from the breakdown as
they are not\r\nsupported. I created a new util for this\r\n- Fixes a
bug unrelated with the breakdown (it also exists in previous\r\nminors).
The LensVis service is computing suggestions and pushes them
to\r\n`availableSuggestionsWithType `. In some indexes (it depends on
the\r\ntypes of the first 5 columns of the index) the lens suggestions
api\r\nmight return a suggestion. So in that case the array has the
histogram\r\nsuggestion + the suggestion from the suggestions api. So
the service\r\nwill pick the first one which is not the histogram. But
we know that in\r\ncase of non transformational commands we want to
suggest the histogram.\r\nSo this PR is fixing it by ensuring that the
array is cleaned up before\r\npushing the histogram
suggestion.\r\n\r\n\r\nNote: The 2 bugs are unrelated I just decided to
fix them in one PR as\r\nthey are both histogram bugs.\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"f962cdcd796af9908449155c989dd03438165773"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195863","number":195863,"mergeCommit":{"message":"[ES|QL]
[Discover] Displays the histogram suggestion always for non
transformational commands (#195863)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195752\r\n\r\nThis PR is fixing
2 bugs:\r\n\r\n- It filters out counter fields from the breakdown as
they are not\r\nsupported. I created a new util for this\r\n- Fixes a
bug unrelated with the breakdown (it also exists in previous\r\nminors).
The LensVis service is computing suggestions and pushes them
to\r\n`availableSuggestionsWithType `. In some indexes (it depends on
the\r\ntypes of the first 5 columns of the index) the lens suggestions
api\r\nmight return a suggestion. So in that case the array has the
histogram\r\nsuggestion + the suggestion from the suggestions api. So
the service\r\nwill pick the first one which is not the histogram. But
we know that in\r\ncase of non transformational commands we want to
suggest the histogram.\r\nSo this PR is fixing it by ensuring that the
array is cleaned up before\r\npushing the histogram
suggestion.\r\n\r\n\r\nNote: The 2 bugs are unrelated I just decided to
fix them in one PR as\r\nthey are both histogram bugs.\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"f962cdcd796af9908449155c989dd03438165773"}}]}]
BACKPORT-->
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
1 parent 93e770c commit b7c0e07
8 files changed
Lines changed: 106 additions & 7 deletions
File tree
- packages/kbn-esql-utils
- src
- utils
- src/plugins/unified_histogram/public
- chart
- services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
66 | 107 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
| 40 | + | |
38 | 41 | | |
39 | | - | |
40 | | - | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
677 | | - | |
| 677 | + | |
| 678 | + | |
678 | 679 | | |
679 | 680 | | |
680 | 681 | | |
| |||
706 | 707 | | |
707 | 708 | | |
708 | 709 | | |
709 | | - | |
| 710 | + | |
710 | 711 | | |
711 | 712 | | |
712 | 713 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
257 | 288 | | |
258 | 289 | | |
259 | 290 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
| |||
0 commit comments