[8.x] [Lens] Do not break when the table has no data (#217937)#218254
Merged
kibanamachine merged 3 commits intoelastic:8.xfrom Apr 16, 2025
Merged
[8.x] [Lens] Do not break when the table has no data (#217937)#218254kibanamachine merged 3 commits intoelastic:8.xfrom
kibanamachine merged 3 commits intoelastic:8.xfrom
Conversation
## Summary When the datatable comes with empty results the visualization fails with bad way <img width="396" alt="image" src="https://github.com/user-attachments/assets/b4e266d7-edbd-452b-9192-84c957fe98db" /> With the fix <img width="756" alt="image" src="https://github.com/user-attachments/assets/d061d29e-9246-432a-944b-308b88d161e7" /> How to replicate: - Create a field ES|QL control with 2 values (extension and geo.dest). You can do it with multiple ways. I created with typing `FROM kibana_sample_data_logs | STATS count = COUNT(*) BY` and then `Create control`. - Use the variable in another panel with query: `FROM kibana_sample_data_logs | WHERE ??field == "css" | KEEP extension` (The control value should be in the extension). This will work - Select the second field (geo.dest). This will return an empty query and will break the table viz. ### Checklist - [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 (cherry picked from commit fa2d391)
1 task
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
cc @stratoula |
stratoula
added a commit
that referenced
this pull request
Jun 11, 2025
# Backport This will backport the following commits from `main` to `9.0`: - [[Lens] Do not break when the table has no data (#217937)](#217937) <!--- Backport version: 10.0.0 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Stratoula Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-04-15T12:03:09Z","message":"[Lens] Do not break when the table has no data (#217937)\n\n## Summary\n\nWhen the datatable comes with empty results the visualization fails with\nbad way\n\n<img width=\"396\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/b4e266d7-edbd-452b-9192-84c957fe98db\"\n/>\n\n\nWith the fix\n<img width=\"756\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/d061d29e-9246-432a-944b-308b88d161e7\"\n/>\n\n\n\nHow to replicate:\n\n- Create a field ES|QL control with 2 values (extension and geo.dest).\nYou can do it with multiple ways. I created with typing `FROM\nkibana_sample_data_logs | STATS count = COUNT(*) BY` and then `Create\ncontrol`.\n- Use the variable in another panel with query: `FROM\nkibana_sample_data_logs | WHERE ??field == \"css\" | KEEP extension` (The\ncontrol value should be in the extension). This will work\n- Select the second field (geo.dest). This will return an empty query\nand will break the table viz.\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"fa2d3912f408326980241df394c51bd87074e21c","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Lens","Feature:ES|QL","backport:version","v9.1.0","v8.19.0"],"title":"[Lens] Do not break when the table has no data","number":217937,"url":"https://github.com/elastic/kibana/pull/217937","mergeCommit":{"message":"[Lens] Do not break when the table has no data (#217937)\n\n## Summary\n\nWhen the datatable comes with empty results the visualization fails with\nbad way\n\n<img width=\"396\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/b4e266d7-edbd-452b-9192-84c957fe98db\"\n/>\n\n\nWith the fix\n<img width=\"756\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/d061d29e-9246-432a-944b-308b88d161e7\"\n/>\n\n\n\nHow to replicate:\n\n- Create a field ES|QL control with 2 values (extension and geo.dest).\nYou can do it with multiple ways. I created with typing `FROM\nkibana_sample_data_logs | STATS count = COUNT(*) BY` and then `Create\ncontrol`.\n- Use the variable in another panel with query: `FROM\nkibana_sample_data_logs | WHERE ??field == \"css\" | KEEP extension` (The\ncontrol value should be in the extension). This will work\n- Select the second field (geo.dest). This will return an empty query\nand will break the table viz.\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"fa2d3912f408326980241df394c51bd87074e21c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217937","number":217937,"mergeCommit":{"message":"[Lens] Do not break when the table has no data (#217937)\n\n## Summary\n\nWhen the datatable comes with empty results the visualization fails with\nbad way\n\n<img width=\"396\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/b4e266d7-edbd-452b-9192-84c957fe98db\"\n/>\n\n\nWith the fix\n<img width=\"756\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/d061d29e-9246-432a-944b-308b88d161e7\"\n/>\n\n\n\nHow to replicate:\n\n- Create a field ES|QL control with 2 values (extension and geo.dest).\nYou can do it with multiple ways. I created with typing `FROM\nkibana_sample_data_logs | STATS count = COUNT(*) BY` and then `Create\ncontrol`.\n- Use the variable in another panel with query: `FROM\nkibana_sample_data_logs | WHERE ??field == \"css\" | KEEP extension` (The\ncontrol value should be in the extension). This will work\n- Select the second field (geo.dest). This will return an empty query\nand will break the table viz.\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"fa2d3912f408326980241df394c51bd87074e21c"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/218254","number":218254,"state":"MERGED","mergeCommit":{"sha":"d35ae396a663a340f859f5fb29ef98fff52fb8ca","message":"[8.x] [Lens] Do not break when the table has no data (#217937) (#218254)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.x`:\n- [[Lens] Do not break when the table has no data\n(#217937)](https://github.com/elastic/kibana/pull/217937)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>"}}]}] BACKPORT-->
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.x:Questions ?
Please refer to the Backport tool documentation