diff --git a/src/plugins/data/public/actions/filters/create_filters_from_value_click.test.ts b/src/plugins/data/public/actions/filters/create_filters_from_value_click.test.ts index a2ebe0e3866d7ab..23d2ab080d75ef1 100644 --- a/src/plugins/data/public/actions/filters/create_filters_from_value_click.test.ts +++ b/src/plugins/data/public/actions/filters/create_filters_from_value_click.test.ts @@ -95,12 +95,7 @@ describe('createFiltersFromValueClick', () => { }); test('handles an event when aggregations type is a terms', async () => { - if (dataPoints[0].table.columns[0].meta) { - if (!dataPoints[0].table.columns[0].meta.params) { - dataPoints[0].table.columns[0].meta.params = {}; - } - dataPoints[0].table.columns[0].meta.params!.type = 'terms'; - } + (dataPoints[0].table.columns[0].meta.sourceParams as any).type = 'terms'; const filters = await createFiltersFromValueClickAction({ data: dataPoints }); expect(filters.length).toEqual(1); diff --git a/src/plugins/expressions/common/expression_types/specs/datatable.ts b/src/plugins/expressions/common/expression_types/specs/datatable.ts index 956efe992b263fd..dc75bfe678ac52a 100644 --- a/src/plugins/expressions/common/expression_types/specs/datatable.ts +++ b/src/plugins/expressions/common/expression_types/specs/datatable.ts @@ -22,7 +22,6 @@ import { map, pick, zipObject } from 'lodash'; import { ExpressionTypeDefinition } from '../types'; import { PointSeries, PointSeriesColumn } from './pointseries'; import { ExpressionValueRender } from './render'; -import { ES_FIELD_TYPES } from '../../../../data/common'; type State = string | number | boolean | null | undefined | SerializableState; @@ -43,7 +42,22 @@ export const isDatatable = (datatable: unknown): datatable is Datatable => /** * This type represents the `type` of any `DatatableColumn` in a `Datatable`. */ -export type DatatableColumnType = ES_FIELD_TYPES; +export type DatatableColumnType = + | '_source' + | 'attachment' + | 'boolean' + | 'date' + | 'geo_point' + | 'geo_shape' + | 'ip' + | 'murmur3' + | 'number' + | 'string' + | 'unknown' + | 'conflict' + | 'object' + | 'nested' + | 'histogram'; /** * This type represents a row in a `Datatable`. diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/rename_columns.ts b/x-pack/plugins/lens/public/indexpattern_datasource/rename_columns.ts index 939e31693558cea..74f143225e29348 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/rename_columns.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/rename_columns.ts @@ -5,11 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import { - ExpressionFunctionDefinition, - Datatable, - DatatableColumn, -} from 'src/plugins/expressions'; +import { ExpressionFunctionDefinition, Datatable, DatatableColumn } from 'src/plugins/expressions'; import { IndexPatternColumn } from './operations'; interface RemapArgs {