From 15abd9a977753a4f251d84dd99d05e828305fb97 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Thu, 23 Nov 2023 16:30:22 +0200 Subject: [PATCH] [ES|QL] Removes the sanitize function from the strategy --- src/plugins/data/common/search/expressions/esql.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/data/common/search/expressions/esql.ts b/src/plugins/data/common/search/expressions/esql.ts index ec30a92bae996..ee434c4d05cfb 100644 --- a/src/plugins/data/common/search/expressions/esql.ts +++ b/src/plugins/data/common/search/expressions/esql.ts @@ -67,10 +67,6 @@ function normalizeType(type: string): DatatableColumnType { } } -function sanitize(value: string) { - return value.replace(/[\(\)]/g, '_'); -} - function extractTypeAndReason(attributes: any): { type?: string; reason?: string } { if (['type', 'reason'].every((prop) => prop in attributes)) { return attributes; @@ -249,8 +245,8 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { map(({ rawResponse: body, warning }) => { const columns = body.columns?.map(({ name, type }) => ({ - id: sanitize(name), - name: sanitize(name), + id: name, + name, meta: { type: normalizeType(type) }, })) ?? []; const columnNames = columns.map(({ name }) => name);