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

[Discover] Fix suggestions for ES|QL charts #197583

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Oct 24, 2024

Fixes #197342

In this PR (#197101) I removed the legacy metric from being suggested in the suggestion panel, and replaced it with the new metric visualization. To maintain the previous behavior in Lens (suggesting a new metric in the same place as legacy metric), we made the score higher for the new metric. This positioned it higher also in the Discover ESQL suggestions. This led to an issue where one expected suggestion didn’t appear because we only display the top 6 suggestions by score and it got pushed out by metric.

Additionally, I made a change here to only display the metric without bucketed columns in the suggestion panel. I don't see there's a lot of value in suggesting bucketed metric unless it's something user chooses intentionally.

Should be merged to 8.x after this: #197337

@mbondyra mbondyra added Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed backport:skip This commit does not require backporting labels Oct 24, 2024
@mbondyra mbondyra marked this pull request as ready for review October 24, 2024 09:44
@mbondyra mbondyra requested review from a team as code owners October 24, 2024 09:44
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@@ -616,7 +615,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(await getCurrentVisTitle()).to.be('Pie');
await testSubjects.existOrFail('partitionVisChart');

await discover.chooseLensSuggestion('barVerticalStacked');
await discover.chooseLensSuggestion('heatMap');
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @mbondyra,

Thanks for looking into it!

I think the idea of this test was to select another type plus apply a customization like on the line below await changeVisShape('Line');.

The heatMap would not have Line as an option. Can we pick something which can be also customized easily here in tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I initially thought that's the case too, but actually these two actions do not have to share a common 'parent' chart type to test what's assumed in the description of this test. What we do in these 2 steps is:

  1. Click on the suggestion and apply it
  2. Open the flyout again and then change the chart type from the chart switcher (can be any available type there).

We lost the access to the bar/line/area chart from the discover suggestions with the change from the pr I linked, so I chose another one, but if it's important to stick to one parent, I've changed to waffle -> treemap. Testing right now and will push once I see it's passed.

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #42 / Spaces app (with solution view) space solution tour solution tour does not show the solution tour after deleting spaces and leave only the default

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 1.5MB 1.5MB -41.0B

History

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Discover changes LGTM. Thanks for unskipping these tests!

@stratoula
Copy link
Contributor

Thanx for working on it Marta, the two metrics in the suggestions really bugged me!

@mbondyra mbondyra merged commit b3b85da into elastic:main Oct 25, 2024
28 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11520900558

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 25, 2024
Fixes elastic#197342

In this PR (elastic#197101) I removed the
legacy metric from being suggested in the suggestion panel, and replaced
it with the new metric visualization. To maintain the previous behavior
in Lens (suggesting a new metric in the same place as legacy metric), we
made the score higher for the new metric. This positioned it higher also
in the Discover ESQL suggestions. This led to an issue where one
expected suggestion didn’t appear because we only display the top 6
suggestions by score and it got pushed out by metric.

Additionally, I made a change here to only display the metric without
bucketed columns in the suggestion panel. I don't see there's a lot of
value in suggesting bucketed metric unless it's something user chooses
intentionally.

Should be merged to 8.x after this:
elastic#197337

(cherry picked from commit b3b85da)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 25, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Discover] Fix suggestions for ES|QL charts
(#197583)](#197583)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marta
Bondyra","email":"4283304+mbondyra@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-25T15:17:02Z","message":"[Discover]
Fix suggestions for ES|QL charts (#197583)\n\nFixes
https://github.com/elastic/kibana/issues/197342\r\n\r\nIn this PR
(#197101) I removed the\r\nlegacy
metric from being suggested in the suggestion panel, and replaced\r\nit
with the new metric visualization. To maintain the previous
behavior\r\nin Lens (suggesting a new metric in the same place as legacy
metric), we\r\nmade the score higher for the new metric. This positioned
it higher also\r\nin the Discover ESQL suggestions. This led to an issue
where one\r\nexpected suggestion didn’t appear because we only display
the top 6\r\nsuggestions by score and it got pushed out by
metric.\r\n\r\nAdditionally, I made a change here to only display the
metric without\r\nbucketed columns in the suggestion panel. I don't see
there's a lot of\r\nvalue in suggesting bucketed metric unless it's
something user chooses\r\nintentionally.\r\n\r\nShould be merged to 8.x
after
this:\r\nhttps://github.com//pull/197337","sha":"b3b85da80d0c9a8431f6a2f2e3c1bdf1448eb1a6","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","Team:Visualizations","release_note:skip","v9.0.0","backport:prev-minor"],"title":"[Discover]
Fix suggestions for ES|QL
charts","number":197583,"url":"https://github.com/elastic/kibana/pull/197583","mergeCommit":{"message":"[Discover]
Fix suggestions for ES|QL charts (#197583)\n\nFixes
https://github.com/elastic/kibana/issues/197342\r\n\r\nIn this PR
(#197101) I removed the\r\nlegacy
metric from being suggested in the suggestion panel, and replaced\r\nit
with the new metric visualization. To maintain the previous
behavior\r\nin Lens (suggesting a new metric in the same place as legacy
metric), we\r\nmade the score higher for the new metric. This positioned
it higher also\r\nin the Discover ESQL suggestions. This led to an issue
where one\r\nexpected suggestion didn’t appear because we only display
the top 6\r\nsuggestions by score and it got pushed out by
metric.\r\n\r\nAdditionally, I made a change here to only display the
metric without\r\nbucketed columns in the suggestion panel. I don't see
there's a lot of\r\nvalue in suggesting bucketed metric unless it's
something user chooses\r\nintentionally.\r\n\r\nShould be merged to 8.x
after
this:\r\nhttps://github.com//pull/197337","sha":"b3b85da80d0c9a8431f6a2f2e3c1bdf1448eb1a6"}},"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/197583","number":197583,"mergeCommit":{"message":"[Discover]
Fix suggestions for ES|QL charts (#197583)\n\nFixes
https://github.com/elastic/kibana/issues/197342\r\n\r\nIn this PR
(#197101) I removed the\r\nlegacy
metric from being suggested in the suggestion panel, and replaced\r\nit
with the new metric visualization. To maintain the previous
behavior\r\nin Lens (suggesting a new metric in the same place as legacy
metric), we\r\nmade the score higher for the new metric. This positioned
it higher also\r\nin the Discover ESQL suggestions. This led to an issue
where one\r\nexpected suggestion didn’t appear because we only display
the top 6\r\nsuggestions by score and it got pushed out by
metric.\r\n\r\nAdditionally, I made a change here to only display the
metric without\r\nbucketed columns in the suggestion panel. I don't see
there's a lot of\r\nvalue in suggesting bucketed metric unless it's
something user chooses\r\nintentionally.\r\n\r\nShould be merged to 8.x
after
this:\r\nhttps://github.com//pull/197337","sha":"b3b85da80d0c9a8431f6a2f2e3c1bdf1448eb1a6"}}]}]
BACKPORT-->

Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.17.0 v9.0.0
Projects
None yet
6 participants