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

[ML] DF Analytics results view: ensure boolean values in charts shown without formatting #78888

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const ColumnChart: FC<Props> = ({ chartData, columnType, dataTestSubj })
name="count"
xScaleType={xScaleType}
yScaleType="linear"
xAccessor="key"
xAccessor={'key_as_string'}
yAccessors={['doc_count']}
styleAccessor={(d) => d.datum.color}
data={data}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const getFieldType = (schema: EuiDataGridColumn['schema']): KBN_FIELD_TYP

interface NumericDataItem {
key: number;
key_as_string?: string;
key_as_string?: string | number;
doc_count: number;
}

Expand Down Expand Up @@ -231,11 +231,13 @@ export const useColumnChart = (
if (isOrdinalChartData(chartData)) {
data = chartData.data.map((d: OrdinalDataItem) => ({
...d,
key_as_string: d.key_as_string ?? d.key,
color: getColor(d),
}));
} else if (isNumericChartData(chartData)) {
data = chartData.data.map((d: NumericDataItem) => ({
...d,
key_as_string: d.key_as_string || d.key,
color: getColor(d),
}));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ export const ExplorationQueryBar: FC<ExplorationQueryBarProps> = ({
/>
</EuiFlexItem>
{filters && filters.options && (
<EuiFlexItem grow={false}>
<EuiFlexItem
grow={false}
data-test-subj="mlDFAnalyticsExplorationQueryBarFilterButtons"
>
<EuiButtonGroup
legend={i18n.translate(
'xpack.ml.dataframe.analytics.explorationQueryBar.buttonGroupLegend',
Expand All @@ -172,7 +175,6 @@ export const ExplorationQueryBar: FC<ExplorationQueryBarProps> = ({
}
)}
name="analyticsQueryBarFilterButtons"
data-test-subj="mlDFAnalyticsExplorationQueryBarFilterButtons"
options={filters.options}
type="multi"
idToSelectedMap={idToSelectedMap}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default function ({ getService }: FtrProviderContext) {
await ml.dataFrameAnalyticsResults.assertClassificationEvaluatePanelElementsExists();
await ml.dataFrameAnalyticsResults.assertClassificationTablePanelExists();
await ml.dataFrameAnalyticsResults.assertResultsTableExists();
await ml.dataFrameAnalyticsResults.assertResultsTableTrainingFiltersExist();
await ml.dataFrameAnalyticsResults.assertResultsTableNotEmpty();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default function ({ getService }: FtrProviderContext) {
await ml.dataFrameAnalyticsResults.assertRegressionEvaluatePanelElementsExists();
await ml.dataFrameAnalyticsResults.assertRegressionTablePanelExists();
await ml.dataFrameAnalyticsResults.assertResultsTableExists();
await ml.dataFrameAnalyticsResults.assertResultsTableTrainingFiltersExist();
await ml.dataFrameAnalyticsResults.assertResultsTableNotEmpty();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export function MachineLearningDataFrameAnalyticsResultsProvider({
await testSubjects.existOrFail('mlExplorationDataGrid loaded', { timeout: 5000 });
},

async assertResultsTableTrainingFiltersExist() {
await testSubjects.existOrFail('mlDFAnalyticsExplorationQueryBarFilterButtons', {
timeout: 5000,
});
},

async getResultTableRows() {
return await testSubjects.findAll('mlExplorationDataGrid loaded > dataGridRow');
},
Expand Down