Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Fix wrong suggestions from Datatable to other visualizations #93920

Merged
merged 3 commits into from
Mar 9, 2021

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Mar 8, 2021

Summary

Fixes #93572

This PR is a proposal fix for the wrong suggestions when using last_value operations in a datatable context, where the first used is of string type.
The proposed solution is a combination of two fixes:

  • 🐛 Update scale on field change in last_value
  • 🐛 Add data type validation at the visualization level

I've attempted to work at the indexpattern level, but this specific scenario requires quite some bit of information, which has already handled by the visualization.
Each visualization knowns better what it can handle, therefore it's easier to model specific vaidation at this level: the only missing bit was the access to the column operation when validating, which has been added.

Screenshot 2021-03-08 at 13 05 35

Screenshot 2021-03-08 at 13 05 19

Screenshot 2021-03-08 at 13 04 41

Screenshot 2021-03-08 at 13 04 28

While the validation will not currently shown, as it is used as filter criteria for the suggestions, in the future it may appear if newer feature enable choosing string data fields as possible choice.

Checklist

Delete any items that are not applicable to this PR.

@dej611 dej611 added v8.0.0 Feature:Lens v7.13.0 release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure auto-backport Deprecated - use backport:version if exact versions are needed labels Mar 8, 2021
@dej611 dej611 marked this pull request as ready for review March 8, 2021 14:28
@dej611 dej611 requested a review from a team March 8, 2021 14:28
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@dej611 dej611 changed the title [Lens] Fix wrong suggestions from Datatble to other visualizations [Lens] Fix wrong suggestions from Datatable to other visualizations Mar 8, 2021
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as expected, LGTM. I like how this will also produce a nice error in the case where a last value of <number field> becomes last value of <string field> because of a mapping/runtime field change.

@dej611
Copy link
Contributor Author

dej611 commented Mar 9, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 920.6KB 921.6KB +994.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dej611 dej611 merged commit 8e6d4ee into elastic:master Mar 9, 2021
@dej611 dej611 deleted the fix/93572 branch March 9, 2021 14:31
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Mar 9, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

7.x / #94096

Successful backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] When having datatable visualization with last value on string, xy chart shouldn't appear in suggestions
4 participants