File tree Expand file tree Collapse file tree
x-pack/plugins/transform/public/app/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,10 +11,6 @@ import {
1111} from '../sections/create_transform/components/step_define/common/filter_agg/components' ;
1212
1313describe ( 'getAggConfigFromEsAgg' , ( ) => {
14- test ( 'should throw an error for unsupported agg' , ( ) => {
15- expect ( ( ) => getAggConfigFromEsAgg ( { terms : { } } , 'test' ) ) . toThrowError ( ) ;
16- } ) ;
17-
1814 test ( 'should return a common config if the agg does not have a custom config defined' , ( ) => {
1915 expect ( getAggConfigFromEsAgg ( { avg : { field : 'region' } } , 'test_1' ) ) . toEqual ( {
2016 agg : 'avg' ,
Original file line number Diff line number Diff line change @@ -110,8 +110,8 @@ export function getAggConfigFromEsAgg(
110110 // Find the main aggregation key
111111 const agg = aggKeys . find ( ( aggKey ) => aggKey !== 'aggs' ) ;
112112
113- if ( ! isPivotSupportedAggs ( agg ) ) {
114- throw new Error ( `Aggregation " ${ agg } " is not supported ` ) ;
113+ if ( agg === undefined ) {
114+ throw new Error ( `Aggregation key is required ` ) ;
115115 }
116116
117117 const commonConfig : PivotAggsConfigBase = {
You can’t perform that action at this time.
0 commit comments