[ML] Fix feature importance decision path not showing up (#79679)
This commit is contained in:
parent
827f0c06fe
commit
478f587b5d
|
@ -45,7 +45,7 @@ export const DataGridTitle: FC<{ title: string }> = ({ title }) => (
|
|||
|
||||
interface PropsWithoutHeader extends UseIndexDataReturnType {
|
||||
baseline?: number;
|
||||
analysisType?: DataFrameAnalysisConfigType;
|
||||
analysisType?: DataFrameAnalysisConfigType | 'unknown';
|
||||
resultsField?: string;
|
||||
dataTestSubj: string;
|
||||
toastNotifications: CoreSetup['notifications']['toasts'];
|
||||
|
|
|
@ -159,11 +159,13 @@ interface LoadEvaluateResult {
|
|||
error: string | null;
|
||||
}
|
||||
|
||||
export const getAnalysisType = (analysis: AnalysisConfig): string => {
|
||||
export const getAnalysisType = (
|
||||
analysis: AnalysisConfig
|
||||
): DataFrameAnalysisConfigType | 'unknown' => {
|
||||
const keys = Object.keys(analysis);
|
||||
|
||||
if (keys.length === 1) {
|
||||
return keys[0];
|
||||
return keys[0] as DataFrameAnalysisConfigType;
|
||||
}
|
||||
|
||||
return 'unknown';
|
||||
|
|
|
@ -23,7 +23,12 @@ import { useColorRange, ColorRangeLegend } from '../../../../../components/color
|
|||
import { DataGrid, UseIndexDataReturnType } from '../../../../../components/data_grid';
|
||||
import { SavedSearchQuery } from '../../../../../contexts/ml';
|
||||
|
||||
import { defaultSearchQuery, DataFrameAnalyticsConfig, SEARCH_SIZE } from '../../../../common';
|
||||
import {
|
||||
defaultSearchQuery,
|
||||
DataFrameAnalyticsConfig,
|
||||
SEARCH_SIZE,
|
||||
getAnalysisType,
|
||||
} from '../../../../common';
|
||||
|
||||
import {
|
||||
ExpandableSection,
|
||||
|
@ -113,6 +118,8 @@ export const ExpandableSectionResults: FC<ExpandableSectionResultsProps> = ({
|
|||
indexData.rowCount,
|
||||
colorRange
|
||||
);
|
||||
const analysisType =
|
||||
jobConfig && jobConfig.analysis ? getAnalysisType(jobConfig.analysis) : undefined;
|
||||
const resultsSectionContent = (
|
||||
<>
|
||||
{jobConfig !== undefined && needsDestIndexPattern && (
|
||||
|
@ -133,6 +140,7 @@ export const ExpandableSectionResults: FC<ExpandableSectionResultsProps> = ({
|
|||
{columnsWithCharts.length > 0 && tableItems.length > 0 && (
|
||||
<DataGrid
|
||||
{...indexData}
|
||||
analysisType={analysisType}
|
||||
dataTestSubj="mlExplorationDataGrid"
|
||||
toastNotifications={getToastNotifications()}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue