Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [ES|QL] [Discover] Displays the histogram suggestion always for…
… non transformational commands (#195863) (#196074) # 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>
- Loading branch information