diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/constants.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/constants.ts index 8c371f4515f4..596ea00c4b7f 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/constants.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/constants.ts @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t, QueryMode } from '@superset-ui/core'; -import { DTTM_ALIAS } from '@superset-ui/core/src/query/buildQueryObject'; +import { t, QueryMode, DTTM_ALIAS } from '@superset-ui/core'; import { ColumnMeta } from './types'; // eslint-disable-next-line import/prefer-default-export diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/buildQueryObject.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/buildQueryObject.ts index 671e9d51b826..befc77c1db80 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/buildQueryObject.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/buildQueryObject.ts @@ -7,8 +7,6 @@ import extractQueryFields from './extractQueryFields'; import { overrideExtraFormData } from './processExtraFormData'; import { AdhocFilter } from './types'; -export const DTTM_ALIAS = '__timestamp'; - /** * Build the common segments of all query objects (e.g. the granularity field derived from * either sql alchemy or druid). The segments specific to each viz type is constructed in the diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/constants.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/constants.ts new file mode 100644 index 000000000000..37011f344141 --- /dev/null +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/constants.ts @@ -0,0 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export const DTTM_ALIAS = '__timestamp'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/extractQueryFields.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/extractQueryFields.ts index ec61ce629a97..700f5a09cb57 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/extractQueryFields.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/extractQueryFields.ts @@ -18,7 +18,7 @@ */ import { t } from '../translation'; import { removeDuplicates } from '../utils'; -import { DTTM_ALIAS } from './buildQueryObject'; +import { DTTM_ALIAS } from './constants'; import getMetricLabel from './getMetricLabel'; import { QueryFields, diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/index.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/index.ts index d38651fb60de..0a5fade22c3f 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/index.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/query/index.ts @@ -19,6 +19,7 @@ import * as ApiLegacy from './api/legacy'; import * as ApiV1 from './api/v1'; +export * from './constants'; export { default as buildQueryContext } from './buildQueryContext'; export { default as buildQueryObject } from './buildQueryObject'; export { default as convertFilter } from './convertFilter'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/test/query/extractQueryFields.test.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/test/query/extractQueryFields.test.ts index 53b40c7d4135..546a2daa3da5 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/test/query/extractQueryFields.test.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/test/query/extractQueryFields.test.ts @@ -18,8 +18,7 @@ */ import extractQueryFields from '@superset-ui/core/src/query/extractQueryFields'; import { configure } from '../../src/translation'; -import { QueryMode } from '../../src'; -import { DTTM_ALIAS } from '../../src/query/buildQueryObject'; +import { QueryMode, DTTM_ALIAS } from '../../src'; import { NUM_METRIC } from '../fixtures'; configure(); diff --git a/superset-frontend/temporary_superset_ui/superset-ui/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processColumns.ts b/superset-frontend/temporary_superset_ui/superset-ui/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processColumns.ts index c2fada62d4a4..f1fbd89549c3 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processColumns.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processColumns.ts @@ -4,12 +4,11 @@ import { getNumberFormatter, NumberFormats, NumberFormatter, + DTTM_ALIAS, } from '@superset-ui/core'; import { createSelector } from 'reselect'; import { PlainObject } from './types'; -const DTTM_ALIAS = '__timestamp'; - type inputType = { columns: string[]; metrics: string[]; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/transformProps.ts b/superset-frontend/temporary_superset_ui/superset-ui/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/transformProps.ts index 4901a57cc37b..3af46cbd1e21 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/transformProps.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/transformProps.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ChartProps, QueryFormMetric, AdhocMetric } from '@superset-ui/core'; +import { ChartProps, QueryFormMetric, AdhocMetric, DTTM_ALIAS } from '@superset-ui/core'; import getProcessColumnsFunction from './processColumns'; import getProcessMetricsFunction from './processMetrics'; import getProcessDataFunction from './processData'; @@ -26,8 +26,6 @@ const processColumns = getProcessColumnsFunction(); const processMetrics = getProcessMetricsFunction(); const processData = getProcessDataFunction(); -const DTTM_ALIAS = '__timestamp'; - type PlainObject = { [key: string]: any; };