mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] do not throw an error when agg is not supported by UI (#72685)
This commit is contained in:
parent
b930cef489
commit
b3f1595331
2 changed files with 2 additions and 6 deletions
|
@ -11,10 +11,6 @@ import {
|
|||
} from '../sections/create_transform/components/step_define/common/filter_agg/components';
|
||||
|
||||
describe('getAggConfigFromEsAgg', () => {
|
||||
test('should throw an error for unsupported agg', () => {
|
||||
expect(() => getAggConfigFromEsAgg({ terms: {} }, 'test')).toThrowError();
|
||||
});
|
||||
|
||||
test('should return a common config if the agg does not have a custom config defined', () => {
|
||||
expect(getAggConfigFromEsAgg({ avg: { field: 'region' } }, 'test_1')).toEqual({
|
||||
agg: 'avg',
|
||||
|
|
|
@ -110,8 +110,8 @@ export function getAggConfigFromEsAgg(
|
|||
// Find the main aggregation key
|
||||
const agg = aggKeys.find((aggKey) => aggKey !== 'aggs');
|
||||
|
||||
if (!isPivotSupportedAggs(agg)) {
|
||||
throw new Error(`Aggregation "${agg}" is not supported`);
|
||||
if (agg === undefined) {
|
||||
throw new Error(`Aggregation key is required`);
|
||||
}
|
||||
|
||||
const commonConfig: PivotAggsConfigBase = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue