Skip to content

Commit

Permalink
[8.x] [Discover] Address the flaky histogram code (elastic#201809) (e…
Browse files Browse the repository at this point in the history
…lastic#202118)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Discover] Address the flaky histogram code
(elastic#201809)](elastic#201809)

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

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

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-28T09:35:29Z","message":"[Discover]
Address the flaky histogram code (elastic#201809)\n\n- Closes
https://github.com/elastic/kibana/issues/201744\r\n- Similar to
https://github.com/elastic/kibana/issues/184600\r\n\r\n##
Summary\r\n\r\nThis PR fixes the issues with the transition from a data
view without a\r\ntime field to a data view with a time
field.\r\n\r\nPreviously reported error:\r\n![management Index patterns
on aliases discover verify hits should be\r\nable
to\r\ndisc-4da8c0b87362e3312cae00dc943a984acfda9af98d821decb6f48164eaca21ae](https://github.com/user-attachments/assets/652096ef-70c1-4394-a665-6b2b15d976ec)","sha":"f50b93c29004f8dac0fc6d1b44e6a8497a0cf2ea","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:DataDiscovery","v8.16.0","backport:version","v8.17.0","v8.18.0"],"title":"[Discover]
Address the flaky histogram
code","number":201809,"url":"https://github.com/elastic/kibana/pull/201809","mergeCommit":{"message":"[Discover]
Address the flaky histogram code (elastic#201809)\n\n- Closes
https://github.com/elastic/kibana/issues/201744\r\n- Similar to
https://github.com/elastic/kibana/issues/184600\r\n\r\n##
Summary\r\n\r\nThis PR fixes the issues with the transition from a data
view without a\r\ntime field to a data view with a time
field.\r\n\r\nPreviously reported error:\r\n![management Index patterns
on aliases discover verify hits should be\r\nable
to\r\ndisc-4da8c0b87362e3312cae00dc943a984acfda9af98d821decb6f48164eaca21ae](https://github.com/user-attachments/assets/652096ef-70c1-4394-a665-6b2b15d976ec)","sha":"f50b93c29004f8dac0fc6d1b44e6a8497a0cf2ea"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201809","number":201809,"mergeCommit":{"message":"[Discover]
Address the flaky histogram code (elastic#201809)\n\n- Closes
https://github.com/elastic/kibana/issues/201744\r\n- Similar to
https://github.com/elastic/kibana/issues/184600\r\n\r\n##
Summary\r\n\r\nThis PR fixes the issues with the transition from a data
view without a\r\ntime field to a data view with a time
field.\r\n\r\nPreviously reported error:\r\n![management Index patterns
on aliases discover verify hits should be\r\nable
to\r\ndisc-4da8c0b87362e3312cae00dc943a984acfda9af98d821decb6f48164eaca21ae](https://github.com/user-attachments/assets/652096ef-70c1-4394-a665-6b2b15d976ec)","sha":"f50b93c29004f8dac0fc6d1b44e6a8497a0cf2ea"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <[email protected]>
  • Loading branch information
kibanamachine and jughosta authored Nov 28, 2024
1 parent 82ed88e commit ec139ff
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,13 @@ export class LensVisService {
queryParams: QueryParams;
timeInterval: string | undefined;
breakdownField: DataViewField | undefined;
}): Suggestion => {
}): Suggestion | undefined => {
const { dataView } = queryParams;

if (!dataView.isTimeBased() || !dataView.timeFieldName) {
return undefined;
}

const showBreakdown = breakdownField && fieldSupportsBreakdown(breakdownField);

let columnOrder = ['date_column', 'count_column'];
Expand All @@ -343,7 +348,7 @@ export class LensVisService {
date_column: {
dataType: 'date',
isBucketed: true,
label: dataView.timeFieldName ?? '',
label: dataView.timeFieldName,
operationType: 'date_histogram',
scale: 'interval',
sourceField: dataView.timeFieldName,
Expand Down

0 comments on commit ec139ff

Please sign in to comment.