[Lens] Do not break when the table has no data#217937
[Lens] Do not break when the table has no data#217937stratoula merged 4 commits intoelastic:mainfrom
Conversation
|
/ci |
markov00
left a comment
There was a problem hiding this comment.
Definitely better then the "red" error, it fixes the error it self.
Do you think we can also just return undefined immediately if columnsReverseLookup[field] is undefined? just to avoid any other calculation and wrongly returned invalid data?
I actually reached this different screen instead of the no-data result, with a table that scrolls a lot without data in it.
The content of the control where geo.dest, extension and extension.keyword
In order to get into the no data screen you need to select in the control a different than the extension field. The geo.dest for example. Because in your query you filter with extension so this will return data but if you do |
We could, check here f0d2b74 |
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
|
Starting backport for target branches: 8.x |
## 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)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[Lens] Do not break when the table has no data (#217937)](#217937) <!--- Backport version: 9.6.6 --> ### 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":["8.x"],"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,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## 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)
# 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-->
Summary
When the datatable comes with empty results the visualization fails with bad way
With the fix

How to replicate:
FROM kibana_sample_data_logs | STATS count = COUNT(*) BYand thenCreate control.FROM kibana_sample_data_logs | WHERE ??field == "css" | KEEP extension(The control value should be in the extension). This will workChecklist
fixes #222848