Advanced input does not work for visualizations (#88154)
* Advanced input does not work for visualizations * Remove unnecessary imports and update tests
This commit is contained in:
parent
2c8b518f69
commit
5167e731df
|
@ -108,13 +108,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -152,7 +152,6 @@ export const aggDateHistogram = (): FunctionDefinition => ({
|
|||
...rest,
|
||||
timeRange: getParsedValue(args, 'timeRange'),
|
||||
extended_bounds: getParsedValue(args, 'extended_bounds'),
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -88,14 +88,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'date_field',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -107,7 +107,6 @@ export const aggDateRange = (): FunctionDefinition => ({
|
|||
type: BUCKET_TYPES.DATE_RANGE,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
ranges: getParsedValue(args, 'ranges'),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -73,13 +73,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -95,7 +95,6 @@ export const aggFilter = (): FunctionDefinition => ({
|
|||
type: BUCKET_TYPES.FILTER,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
geo_bounding_box: getParsedValue(args, 'geo_bounding_box'),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -79,13 +79,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -90,7 +90,6 @@ export const aggFilters = (): FunctionDefinition => ({
|
|||
params: {
|
||||
...rest,
|
||||
filters: getParsedValue(args, 'filters'),
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -99,14 +99,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'geo_field',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -126,7 +126,6 @@ export const aggGeoHash = (): FunctionDefinition => ({
|
|||
params: {
|
||||
...rest,
|
||||
boundingBox: getParsedValue(args, 'boundingBox'),
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -78,14 +78,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'geo_field',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, BUCKET_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggGeoTileFnName = 'aggGeoTile';
|
||||
|
||||
|
@ -105,7 +104,6 @@ export const aggGeoTile = (): FunctionDefinition => ({
|
|||
type: BUCKET_TYPES.GEOTILE_GRID,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -98,15 +98,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'field',
|
||||
interval: '10',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -135,7 +135,6 @@ export const aggHistogram = (): FunctionDefinition => ({
|
|||
params: {
|
||||
...rest,
|
||||
extended_bounds: getParsedValue(args, 'extended_bounds'),
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -88,15 +88,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'ip_field',
|
||||
ipRangeType: IP_RANGE_TYPES.FROM_TO,
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -110,7 +110,6 @@ export const aggIpRange = (): FunctionDefinition => ({
|
|||
type: BUCKET_TYPES.IP_RANGE,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
ranges: getParsedValue(args, 'ranges'),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -87,14 +87,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'number_field',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -102,7 +102,6 @@ export const aggRange = (): FunctionDefinition => ({
|
|||
type: BUCKET_TYPES.RANGE,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
ranges: getParsedValue(args, 'ranges'),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -52,14 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
|
||||
expect(() => {
|
||||
fn({
|
||||
delay: '1000ms',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggConfigSerialized } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
import { AggParamsShardDelay, SHARD_DELAY_AGG_NAME } from './shard_delay';
|
||||
|
||||
export const aggShardDelayFnName = 'aggShardDelay';
|
||||
|
@ -93,7 +92,6 @@ export const aggShardDelay = (): FunctionDefinition => ({
|
|||
type: SHARD_DELAY_AGG_NAME,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -84,13 +84,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, BUCKET_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggSignificantTermsFnName = 'aggSignificantTerms';
|
||||
|
||||
|
@ -113,7 +112,6 @@ export const aggSignificantTerms = (): FunctionDefinition => ({
|
|||
type: BUCKET_TYPES.SIGNIFICANT_TERMS,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -154,15 +154,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
order: 'asc',
|
||||
orderBy: '1',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, BUCKET_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggTermsFnName = 'aggTerms';
|
||||
|
||||
|
@ -160,7 +159,6 @@ export const aggTerms = (): FunctionDefinition => ({
|
|||
params: {
|
||||
...rest,
|
||||
orderAgg: args.orderAgg?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggAvgFnName = 'aggAvg';
|
||||
|
||||
|
@ -87,7 +86,6 @@ export const aggAvg = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.AVG,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -67,12 +67,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggBucketAvgFnName = 'aggBucketAvg';
|
||||
|
||||
|
@ -104,7 +103,6 @@ export const aggBucketAvg = (): FunctionDefinition => ({
|
|||
...rest,
|
||||
customBucket: args.customBucket?.value,
|
||||
customMetric: args.customMetric?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -67,12 +67,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggBucketMaxFnName = 'aggBucketMax';
|
||||
|
||||
|
@ -104,7 +103,6 @@ export const aggBucketMax = (): FunctionDefinition => ({
|
|||
...rest,
|
||||
customBucket: args.customBucket?.value,
|
||||
customMetric: args.customMetric?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -67,12 +67,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggBucketMinFnName = 'aggBucketMin';
|
||||
|
||||
|
@ -104,7 +103,6 @@ export const aggBucketMin = (): FunctionDefinition => ({
|
|||
...rest,
|
||||
customBucket: args.customBucket?.value,
|
||||
customMetric: args.customMetric?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -67,12 +67,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggBucketSumFnName = 'aggBucketSum';
|
||||
|
||||
|
@ -104,7 +103,6 @@ export const aggBucketSum = (): FunctionDefinition => ({
|
|||
...rest,
|
||||
customBucket: args.customBucket?.value,
|
||||
customMetric: args.customMetric?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggCardinalityFnName = 'aggCardinality';
|
||||
|
||||
|
@ -92,7 +91,6 @@ export const aggCardinality = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.CARDINALITY,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -108,13 +108,7 @@ describe('agg_expression_functions', () => {
|
|||
buckets_path: 'the_sum',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
buckets_path: 'the_sum',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggCumulativeSumFnName = 'aggCumulativeSum';
|
||||
|
||||
|
@ -107,7 +106,6 @@ export const aggCumulativeSum = (): FunctionDefinition => ({
|
|||
params: {
|
||||
...rest,
|
||||
customMetric: args.customMetric?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -108,13 +108,7 @@ describe('agg_expression_functions', () => {
|
|||
buckets_path: 'the_sum',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
buckets_path: 'the_sum',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggDerivativeFnName = 'aggDerivative';
|
||||
|
||||
|
@ -107,7 +106,6 @@ export const aggDerivative = (): FunctionDefinition => ({
|
|||
params: {
|
||||
...rest,
|
||||
customMetric: args.customMetric?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggGeoBoundsFnName = 'aggGeoBounds';
|
||||
|
||||
|
@ -92,7 +91,6 @@ export const aggGeoBounds = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.GEO_BOUNDS,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggGeoCentroidFnName = 'aggGeoCentroid';
|
||||
|
||||
|
@ -92,7 +91,6 @@ export const aggGeoCentroid = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.GEO_CENTROID,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggMaxFnName = 'aggMax';
|
||||
|
||||
|
@ -87,7 +86,6 @@ export const aggMax = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.MAX,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggMedianFnName = 'aggMedian';
|
||||
|
||||
|
@ -92,7 +91,6 @@ export const aggMedian = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.MEDIAN,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggMinFnName = 'aggMin';
|
||||
|
||||
|
@ -87,7 +86,6 @@ export const aggMin = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.MIN,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -118,13 +118,7 @@ describe('agg_expression_functions', () => {
|
|||
buckets_path: 'the_sum',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
buckets_path: 'the_sum',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggMovingAvgFnName = 'aggMovingAvg';
|
||||
|
||||
|
@ -120,7 +119,6 @@ export const aggMovingAvg = (): FunctionDefinition => ({
|
|||
params: {
|
||||
...rest,
|
||||
customMetric: args.customMetric?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -81,13 +81,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggPercentileRanksFnName = 'aggPercentileRanks';
|
||||
|
||||
|
@ -99,7 +98,6 @@ export const aggPercentileRanks = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.PERCENTILE_RANKS,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -81,13 +81,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggPercentilesFnName = 'aggPercentiles';
|
||||
|
||||
|
@ -99,7 +98,6 @@ export const aggPercentiles = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.PERCENTILES,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -108,13 +108,7 @@ describe('agg_expression_functions', () => {
|
|||
buckets_path: 'the_sum',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
json: '/// intentionally malformed json ///',
|
||||
buckets_path: 'the_sum',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
|
|||
import { Assign } from '@kbn/utility-types';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggSerialDiffFnName = 'aggSerialDiff';
|
||||
|
||||
|
@ -107,7 +106,6 @@ export const aggSerialDiff = (): FunctionDefinition => ({
|
|||
params: {
|
||||
...rest,
|
||||
customMetric: args.customMetric?.value,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggStdDeviationFnName = 'aggStdDeviation';
|
||||
|
||||
|
@ -92,7 +91,6 @@ export const aggStdDeviation = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.STD_DEV,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,13 +52,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggSumFnName = 'aggSum';
|
||||
|
||||
|
@ -87,7 +86,6 @@ export const aggSum = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.SUM,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -89,14 +89,7 @@ describe('agg_expression_functions', () => {
|
|||
json: '{ "foo": true }',
|
||||
});
|
||||
|
||||
expect(actual.value.params.json).toEqual({ foo: true });
|
||||
expect(() => {
|
||||
fn({
|
||||
field: 'machine.os.keyword',
|
||||
aggregate: 'min',
|
||||
json: '/// intentionally malformed json ///',
|
||||
});
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"Unable to parse json argument string"`);
|
||||
expect(actual.value.params.json).toEqual('{ "foo": true }');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
|
||||
import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../';
|
||||
import { getParsedValue } from '../utils/get_parsed_value';
|
||||
|
||||
export const aggTopHitFnName = 'aggTopHit';
|
||||
|
||||
|
@ -119,7 +118,6 @@ export const aggTopHit = (): FunctionDefinition => ({
|
|||
type: METRIC_TYPES.TOP_HITS,
|
||||
params: {
|
||||
...rest,
|
||||
json: getParsedValue(args, 'json'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue