forked from elastic/kibana
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Data frame analytics: Exploration page bug fixes. (elastic#44496) (
elastic#44617) Fixes various issues with the data frame analytics outlier detection results page. - Fixes the default sorting and sets it to descending outlier_score. - Fixes to retain the sorting when columns are enabled/disabled via the options menu. Previously the sorting would be reset to use the left most column. - Fixes the sorting to be applied to get the data for the table from Elasticsearch when the user changes sorting by clicking on the arrows on the table column headers. Previously only on load the data would be loaded once (1000 docs sort by outlier_score descending) and sorting would only by applied to this initially loaded data. - Consolidates redundant TypeScript specifications in in_memory_table.ts.
- Loading branch information
Showing
10 changed files
with
415 additions
and
313 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
33 changes: 33 additions & 0 deletions
33
...ic/data_frame_analytics/pages/analytics_exploration/components/exploration/common.test.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { DataFrameAnalyticsConfig } from '../../../../common'; | ||
|
||
import { getOutlierScoreFieldName } from './common'; | ||
|
||
describe('Data Frame Analytics: <Exploration /> common utils', () => { | ||
test('getOutlierScoreFieldName()', () => { | ||
const jobConfig: DataFrameAnalyticsConfig = { | ||
id: 'the-id', | ||
analysis: { outlier_detection: {} }, | ||
dest: { | ||
index: 'the-dest-index', | ||
results_field: 'the-results-field', | ||
}, | ||
source: { | ||
index: 'the-source-index', | ||
}, | ||
analyzed_fields: { includes: [], excludes: [] }, | ||
model_memory_limit: '50mb', | ||
create_time: 1234, | ||
version: '1.0.0', | ||
}; | ||
|
||
const outlierScoreFieldName = getOutlierScoreFieldName(jobConfig); | ||
|
||
expect(outlierScoreFieldName).toMatch('the-results-field.outlier_score'); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
.../public/data_frame_analytics/pages/analytics_exploration/components/exploration/common.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { DataFrameAnalyticsConfig } from '../../../../common'; | ||
|
||
const OUTLIER_SCORE = 'outlier_score'; | ||
|
||
export const getOutlierScoreFieldName = (jobConfig: DataFrameAnalyticsConfig) => | ||
`${jobConfig.dest.results_field}.${OUTLIER_SCORE}`; |
Oops, something went wrong.