diff --git a/UPDATING.md b/UPDATING.md index c3d1de14d56..df8ab20a46f 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -24,6 +24,8 @@ assists people when migrating to a new version. ## Next +- [18936](https://github.com/apache/superset/pull/18936): Removes legacy SIP-15 interm logic/flags—specifically the `SIP_15_ENABLED`, `SIP_15_GRACE_PERIOD_END`, `SIP_15_DEFAULT_TIME_RANGE_ENDPOINTS`, and `SIP_15_TOAST_MESSAGE` flags. Time range endpoints are no longer configurable and strictly adhere to the `[start, end)` paradigm, i.e., inclusive of the start and exclusive of the end. Additionally this change removes the now obsolete `time_range_endpoints` from the form-data and resulting in the cache being busted. + ### Breaking Changes - [18976](https://github.com/apache/superset/pull/18976): When running the app in debug mode, the app will default to use `SimpleCache` for `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG`. When running in non-debug mode, a cache backend will need to be defined, otherwise the application will fail to start. For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs. diff --git a/docs/docs/installation/configuring-superset.mdx b/docs/docs/installation/configuring-superset.mdx index cd4b2f8d14f..12bfb342a19 100644 --- a/docs/docs/installation/configuring-superset.mdx +++ b/docs/docs/installation/configuring-superset.mdx @@ -242,64 +242,3 @@ FEATURE_FLAGS = { ``` A current list of feature flags can be found in [RESOURCES/FEATURE_FLAGS.md](https://github.com/apache/superset/blob/master/RESOURCES/FEATURE_FLAGS.md). - -### SIP 15 - -[Superset Improvement Proposal 15](https://github.com/apache/superset/issues/6360) aims to -ensure that time intervals are handled in a consistent and transparent manner for both the Druid and -SQLAlchemy connectors. - -Prior to SIP-15 SQLAlchemy used inclusive endpoints however these may behave like exclusive for -string columns (due to lexicographical ordering) if no formatting was defined and the column -formatting did not conform to an ISO 8601 date-time (refer to the SIP for details). - -To remedy this rather than having to define the date/time format for every non-IS0 8601 date-time -column, once can define a default column mapping on a per database level via the `extra` parameter: - -``` -{ - "python_date_format_by_column_name": { - "ds": "%Y-%m-%d" - } -} -``` - -**New Deployments** - -All new deployments should enable SIP-15 by setting this value in `superset_config.py`: - -``` -SIP_15_ENABLED = True - -``` - -**Existing Deployments** - -Given that it is not apparent whether the chart creator was aware of the time range inconsistencies -(and adjusted the endpoints accordingly) changing the behavior of all charts is overly aggressive. -Instead SIP-15 proivides a soft transistion allowing producers (chart owners) to see the impact of -the proposed change and adjust their charts accordingly. - -Prior to enabling SIP-15, existing deployments should communicate to their users the impact of the -change and define a grace period end date (exclusive of course) after which all charts will conform -to the [start, end) interval. - -```python -from datetime import date - -SIP_15_ENABLED = True -SIP_15_GRACE_PERIOD_END = date(, ,
) -``` - -To aid with transparency the current endpoint behavior is explicitly called out in the chart time -range (post SIP-15 this will be [start, end) for all connectors and databases). One can override the -defaults on a per database level via the `extra` parameter. - -```python -{ - "time_range_endpoints": ["inclusive", "inclusive"] -} -``` - -Note in a future release the interim SIP-15 logic will be removed (including the -`time_grain_endpoints` form-data field) via a code change and Alembic migration. diff --git a/docs/static/resources/openapi.json b/docs/static/resources/openapi.json index 1d65671bf38..86d07ad8264 100644 --- a/docs/static/resources/openapi.json +++ b/docs/static/resources/openapi.json @@ -683,10 +683,6 @@ "nullable": true, "type": "string" }, - "time_range_endpoints": { - "items": {}, - "type": "array" - }, "where": { "description": "WHERE clause to be added to queries using AND operator.", "type": "string" diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts index f4a6f9df4a4..b06c1b3ce38 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts @@ -412,7 +412,6 @@ describe('Nativefilters Sanity test', () => { viz_type: 'echarts_timeseries', datasource: '3__table', granularity_sqla: 'purpose__last_set', - time_range_endpoints: ['inclusive', 'exclusive'], time_grain_sqla: 'P1D', time_range: 'No filter', metrics: ['count'], diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx index 1c99593ad85..17c9e504238 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx @@ -91,15 +91,6 @@ export const datasourceAndVizType: ControlPanelSectionConfig = { ), }, }, - { - name: 'time_range_endpoints', - config: { - type: 'HiddenControl', - label: t('Time range endpoints'), - hidden: true, - description: t('Time range endpoints (SIP-15)'), - }, - }, ], ], }; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.tsx index 1c9ea8d8d4a..8163dd97d7d 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.tsx @@ -323,7 +323,6 @@ const time_range: SharedControlConfig<'DateFilterControl'> = { ), mapStateToProps: ({ datasource, form_data }) => ({ datasource, - endpoints: form_data?.time_range_endpoints || null, }), }; diff --git a/superset-frontend/packages/superset-ui-core/src/query/constants.ts b/superset-frontend/packages/superset-ui-core/src/query/constants.ts index 2f85841991c..4a3fe5ff547 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/constants.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/constants.ts @@ -27,13 +27,7 @@ import { export const DTTM_ALIAS = '__timestamp'; export const EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS: (keyof ExtraFormDataOverrideExtras)[] = - [ - 'druid_time_origin', - 'relative_start', - 'relative_end', - 'time_grain_sqla', - 'time_range_endpoints', - ]; + ['druid_time_origin', 'relative_start', 'relative_end', 'time_grain_sqla']; export const EXTRA_FORM_DATA_APPEND_KEYS: (keyof ExtraFormDataAppend)[] = [ 'adhoc_filters', diff --git a/superset-frontend/packages/superset-ui-core/src/query/extractExtras.ts b/superset-frontend/packages/superset-ui-core/src/query/extractExtras.ts index 835dde79961..aea2881b25d 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/extractExtras.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/extractExtras.ts @@ -89,9 +89,5 @@ export default function extractExtras(formData: QueryFormData): ExtractedExtra { delete extract.time_grain_sqla; } - // map time range endpoints: - if (formData.time_range_endpoints) - extras.time_range_endpoints = formData.time_range_endpoints; - return extract; } diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/Query.ts b/superset-frontend/packages/superset-ui-core/src/query/types/Query.ts index 41708d9dc5c..c9961cc7cb4 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/Query.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/Query.ts @@ -19,7 +19,7 @@ */ import { DatasourceType } from './Datasource'; import { BinaryOperator, SetOperator, UnaryOperator } from './Operator'; -import { AppliedTimeExtras, TimeRange, TimeRangeEndpoints } from './Time'; +import { AppliedTimeExtras, TimeRange } from './Time'; import { AnnotationLayer } from './AnnotationLayer'; import { QueryFields, @@ -59,7 +59,6 @@ export type QueryObjectExtras = Partial<{ relative_start?: string; relative_end?: string; time_grain_sqla?: TimeGranularity; - time_range_endpoints?: TimeRangeEndpoints; /** WHERE condition */ where?: string; }>; diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts b/superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts index e799f7cccd2..f23ed2858d7 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts @@ -30,7 +30,7 @@ import { QueryObjectExtras, QueryObjectFilterClause, } from './Query'; -import { TimeRange, TimeRangeEndpoints } from './Time'; +import { TimeRange } from './Time'; import { TimeGranularity } from '../../time-format'; import { JsonObject } from '../../connection'; import { AdhocColumn, PhysicalColumn } from './Column'; @@ -120,11 +120,7 @@ export type ExtraFormDataAppend = { * filter clauses can't be overridden */ export type ExtraFormDataOverrideExtras = Pick< QueryObjectExtras, - | 'druid_time_origin' - | 'relative_start' - | 'relative_end' - | 'time_grain_sqla' - | 'time_range_endpoints' + 'druid_time_origin' | 'relative_start' | 'relative_end' | 'time_grain_sqla' >; /** These parameters override those already present in the form data/query object */ @@ -180,7 +176,6 @@ export interface BaseFormData extends TimeRange, FormDataResidual { force?: boolean; result_format?: string; result_type?: string; - time_range_endpoints?: TimeRangeEndpoints; annotation_layers?: AnnotationLayer[]; url_params?: Record; custom_params?: Record; diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/Time.ts b/superset-frontend/packages/superset-ui-core/src/query/types/Time.ts index 614cc02b54b..820c3f1a3c8 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/Time.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/Time.ts @@ -37,7 +37,4 @@ export type AppliedTimeExtras = Partial< Record >; -export type TimeRangeEndpoint = 'unknown' | 'inclusive' | 'exclusive'; -export type TimeRangeEndpoints = [TimeRangeEndpoint, TimeRangeEndpoint]; - export default {}; diff --git a/superset-frontend/packages/superset-ui-core/test/query/extractExtras.test.ts b/superset-frontend/packages/superset-ui-core/test/query/extractExtras.test.ts index defcb80986b..ca6ab730d1a 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/extractExtras.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/extractExtras.test.ts @@ -30,7 +30,6 @@ describe('extractExtras', () => { expect( extractExtras({ ...baseQueryFormData, - time_range_endpoints: ['inclusive', 'exclusive'], extra_filters: [ { col: '__time_col', @@ -57,7 +56,6 @@ describe('extractExtras', () => { }, extras: { time_grain_sqla: 'PT5M', - time_range_endpoints: ['inclusive', 'exclusive'], }, filters: [], granularity: 'ds2', @@ -107,7 +105,6 @@ describe('extractExtras', () => { expect( extractExtras({ ...baseQueryFormData, - time_range_endpoints: ['inclusive', 'exclusive'], extra_filters: [ { col: 'gender', @@ -139,7 +136,6 @@ describe('extractExtras', () => { }, extras: { time_grain_sqla: 'PT5M', - time_range_endpoints: ['inclusive', 'exclusive'], }, filters: [ { diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/geojsonPayload.js b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/geojsonPayload.js index e3d446a7689..eb37db01682 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/geojsonPayload.js +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/geojsonPayload.js @@ -26,7 +26,6 @@ export default { datasource: '93829__table', viz_type: 'deck_polygon', url_params: {}, - time_range_endpoints: ['inclusive', 'exclusive'], granularity_sqla: null, time_range: '100 years ago : ', line_column: 'geometry', diff --git a/superset-frontend/src/dashboard/components/SliceHeader/SliceHeader.test.tsx b/superset-frontend/src/dashboard/components/SliceHeader/SliceHeader.test.tsx index 27abbd396f3..b1a2efc7b87 100644 --- a/superset-frontend/src/dashboard/components/SliceHeader/SliceHeader.test.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeader/SliceHeader.test.tsx @@ -129,8 +129,6 @@ const createProps = () => ({ row_limit: 10000, show_legend: false, time_range: 'No filter', - time_range_endpoints: ['inclusive', 'exclusive'], - url_params: {}, viz_type: 'dist_bar', x_ticks_layout: 'auto', y_axis_format: 'SMART_NUMBER', diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/SliceHeaderControls.test.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/SliceHeaderControls.test.tsx index c5a19de74a8..945cb002523 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/SliceHeaderControls.test.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/SliceHeaderControls.test.tsx @@ -66,7 +66,6 @@ const createProps = (viz_type = 'sunburst') => ({ row_limit: 10000, slice_id: 371, time_range: 'No filter', - time_range_endpoints: ['inclusive', 'exclusive'], url_params: {}, viz_type, }, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx index d698c9214c5..b873d0f4434 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx @@ -967,7 +967,6 @@ const FiltersConfigForm = ( > { setNativeFilterFieldValues(form, filterId, { time_range: timeRange, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/utils.ts b/superset-frontend/src/dashboard/components/nativeFilters/utils.ts index 1ebba4619e3..3adaecc656a 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/utils.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/utils.ts @@ -82,7 +82,6 @@ export const getFormData = ({ showSearch: true, defaultValue: defaultDataMask?.filterState?.value, time_range, - time_range_endpoints: ['inclusive', 'exclusive'], url_params: extractUrlParams('regular'), inView: true, viz_type: filterType, diff --git a/superset-frontend/src/dashboard/util/filterboxMigrationHelper.test.ts b/superset-frontend/src/dashboard/util/filterboxMigrationHelper.test.ts index bae1d8f1f2e..82ed0dd8ac4 100644 --- a/superset-frontend/src/dashboard/util/filterboxMigrationHelper.test.ts +++ b/superset-frontend/src/dashboard/util/filterboxMigrationHelper.test.ts @@ -57,7 +57,6 @@ const regionFilter = { show_bubbles: true, slice_id: 32, time_range: '2014-01-01 : 2014-01-02', - time_range_endpoints: ['inclusive', 'exclusive'], viz_type: 'filter_box', }, modified: '', @@ -85,7 +84,6 @@ const chart1 = { show_bubbles: true, slice_id: 33, time_range: '2000 : 2014-01-02', - time_range_endpoints: ['inclusive', 'exclusive'], viz_type: 'big_number', }, modified: "", diff --git a/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.test.tsx b/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.test.tsx index 380285b8115..9905d8f5c6d 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.test.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.test.tsx @@ -30,7 +30,6 @@ const createProps = () => ({ datasource: '34__table', slice_id: 456, url_params: {}, - time_range_endpoints: ['unknown', 'inclusive'], time_range: 'Last week', all_columns_x: 'source', all_columns_y: 'target', diff --git a/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.tsx b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.tsx index 47077f61c81..54856ff78e4 100644 --- a/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.tsx +++ b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.tsx @@ -31,7 +31,6 @@ const createProps = () => ({ datasource: '49__table', slice_id: 318, url_params: {}, - time_range_endpoints: ['inclusive', 'exclusive'], granularity_sqla: 'time_start', time_range: 'No filter', all_columns_x: ['age'], @@ -65,7 +64,6 @@ const createProps = () => ({ row_limit: 10000, slice_id: 318, time_range: 'No filter', - time_range_endpoints: ['inclusive', 'exclusive'], url_params: {}, viz_type: 'histogram', x_axis_label: 'age', diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx b/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx index 2033d3368e1..3cfaf77e77c 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx @@ -30,7 +30,6 @@ const createProps = () => ({ datasource: '49__table', slice_id: 318, url_params: {}, - time_range_endpoints: ['inclusive', 'exclusive'], granularity_sqla: 'time_start', time_range: 'No filter', all_columns_x: ['age'], @@ -66,7 +65,6 @@ const createProps = () => ({ row_limit: 10000, slice_id: 318, time_range: 'No filter', - time_range_endpoints: ['inclusive', 'exclusive'], url_params: {}, viz_type: 'histogram', x_axis_label: 'age', diff --git a/superset-frontend/src/explore/components/PropertiesModal/PropertiesModal.test.tsx b/superset-frontend/src/explore/components/PropertiesModal/PropertiesModal.test.tsx index ef07ea3b78a..f9cdca0277f 100644 --- a/superset-frontend/src/explore/components/PropertiesModal/PropertiesModal.test.tsx +++ b/superset-frontend/src/explore/components/PropertiesModal/PropertiesModal.test.tsx @@ -48,7 +48,6 @@ const createProps = () => ({ row_limit: 10000, slice_id: 318, time_range: 'No filter', - time_range_endpoints: ['inclusive', 'exclusive'], url_params: {}, viz_type: 'histogram', x_axis_label: 'age', @@ -108,7 +107,7 @@ fetchMock.get('glob:*/api/v1/chart/318', { }, ], params: - '{"adhoc_filters": [], "all_columns_x": ["age"], "color_scheme": "supersetColors", "datasource": "42__table", "granularity_sqla": "time_start", "groupby": null, "label_colors": {}, "link_length": "25", "queryFields": {"groupby": "groupby"}, "row_limit": 10000, "slice_id": 1380, "time_range": "No filter", "time_range_endpoints": ["inclusive", "exclusive"], "url_params": {}, "viz_type": "histogram", "x_axis_label": "age", "y_axis_label": "count"}', + '{"adhoc_filters": [], "all_columns_x": ["age"], "color_scheme": "supersetColors", "datasource": "42__table", "granularity_sqla": "time_start", "groupby": null, "label_colors": {}, "link_length": "25", "queryFields": {"groupby": "groupby"}, "row_limit": 10000, "slice_id": 1380, "time_range": "No filter", "url_params": {}, "viz_type": "histogram", "x_axis_label": "age", "y_axis_label": "count"}', slice_name: 'Age distribution of respondents', viz_type: 'histogram', }, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx index 80f28729598..ee979a1c72d 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx @@ -18,13 +18,7 @@ */ import React, { useState, useEffect, useMemo } from 'react'; import rison from 'rison'; -import { - SupersetClient, - styled, - t, - TimeRangeEndpoints, - useTheme, -} from '@superset-ui/core'; +import { SupersetClient, styled, t, useTheme } from '@superset-ui/core'; import { buildTimeRangeString, formatTimeRange, @@ -71,10 +65,7 @@ const guessFrame = (timeRange: string): FrameType => { return 'Advanced'; }; -const fetchTimeRange = async ( - timeRange: string, - endpoints?: TimeRangeEndpoints, -) => { +const fetchTimeRange = async (timeRange: string) => { const query = rison.encode_uri(timeRange); const endpoint = `/api/v1/time_range/?q=${query}`; try { @@ -84,7 +75,7 @@ const fetchTimeRange = async ( response?.json?.result?.until || '', ); return { - value: formatTimeRange(timeRangeString, endpoints), + value: formatTimeRange(timeRangeString), }; } catch (response) { const clientError = await getClientErrorObject(response); @@ -171,7 +162,6 @@ interface DateFilterControlProps { name: string; onChange: (timeRange: string) => void; value?: string; - endpoints?: TimeRangeEndpoints; type?: Type; } @@ -181,7 +171,7 @@ export const getDateFilterControlTestId = testWithId( ); export default function DateFilterLabel(props: DateFilterControlProps) { - const { value = DEFAULT_TIME_RANGE, endpoints, onChange, type } = props; + const { value = DEFAULT_TIME_RANGE, onChange, type } = props; const [actualTimeRange, setActualTimeRange] = useState(value); const [show, setShow] = useState(false); @@ -194,7 +184,7 @@ export default function DateFilterLabel(props: DateFilterControlProps) { const [tooltipTitle, setTooltipTitle] = useState(value); useEffect(() => { - fetchTimeRange(value, endpoints).then(({ value: actualRange, error }) => { + fetchTimeRange(value).then(({ value: actualRange, error }) => { if (error) { setEvalResponse(error || ''); setValidTimeRange(false); @@ -235,18 +225,16 @@ export default function DateFilterLabel(props: DateFilterControlProps) { useDebouncedEffect( () => { if (lastFetchedTimeRange !== timeRangeValue) { - fetchTimeRange(timeRangeValue, endpoints).then( - ({ value: actualRange, error }) => { - if (error) { - setEvalResponse(error || ''); - setValidTimeRange(false); - } else { - setEvalResponse(actualRange || ''); - setValidTimeRange(true); - } - setLastFetchedTimeRange(timeRangeValue); - }, - ); + fetchTimeRange(timeRangeValue).then(({ value: actualRange, error }) => { + if (error) { + setEvalResponse(error || ''); + setValidTimeRange(false); + } else { + setEvalResponse(actualRange || ''); + setValidTimeRange(true); + } + setLastFetchedTimeRange(timeRangeValue); + }); } }, SLOW_DEBOUNCE, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/utils/dateFilterUtils.ts b/superset-frontend/src/explore/components/controls/DateFilterControl/utils/dateFilterUtils.ts index 8ad5f1d8d83..fc14dd9855b 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/utils/dateFilterUtils.ts +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/utils/dateFilterUtils.ts @@ -16,8 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import { TimeRangeEndpoints } from '@superset-ui/core'; - export const SEPARATOR = ' : '; export const buildTimeRangeString = (since: string, until: string): string => @@ -26,17 +24,11 @@ export const buildTimeRangeString = (since: string, until: string): string => const formatDateEndpoint = (dttm: string, isStart?: boolean): string => dttm.replace('T00:00:00', '') || (isStart ? '-∞' : '∞'); -export const formatTimeRange = ( - timeRange: string, - endpoints?: TimeRangeEndpoints, -) => { +export const formatTimeRange = (timeRange: string) => { const splitDateRange = timeRange.split(SEPARATOR); if (splitDateRange.length === 1) return timeRange; - const formattedEndpoints = (endpoints || ['unknown', 'unknown']).map( - (endpoint: string) => (endpoint === 'inclusive' ? '≤' : '<'), - ); - - return `${formatDateEndpoint(splitDateRange[0], true)} ${ - formattedEndpoints[0] - } col ${formattedEndpoints[1]} ${formatDateEndpoint(splitDateRange[1])}`; + return `${formatDateEndpoint( + splitDateRange[0], + true, + )} ≤ col < ${formatDateEndpoint(splitDateRange[1])}`; }; diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/utils/utils.test.ts b/superset-frontend/src/explore/components/controls/DateFilterControl/utils/utils.test.ts index 012aab606c7..3a0debfec88 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/utils/utils.test.ts +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/utils/utils.test.ts @@ -316,19 +316,16 @@ describe('formatTimeRange', () => { expect(formatTimeRange('Last 7 days')).toBe('Last 7 days'); expect(formatTimeRange('No filter')).toBe('No filter'); expect(formatTimeRange('Yesterday : Tomorrow')).toBe( - 'Yesterday < col < Tomorrow', + 'Yesterday ≤ col < Tomorrow', + ); + expect(formatTimeRange('2010-07-30T00:00:00 : 2020-07-30T00:00:00')).toBe( + '2010-07-30 ≤ col < 2020-07-30', + ); + expect(formatTimeRange('2010-07-30T01:00:00 : ')).toBe( + '2010-07-30T01:00:00 ≤ col < ∞', ); - expect( - formatTimeRange('2010-07-30T00:00:00 : 2020-07-30T00:00:00', [ - 'inclusive', - 'exclusive', - ]), - ).toBe('2010-07-30 ≤ col < 2020-07-30'); - expect( - formatTimeRange('2010-07-30T01:00:00 : ', ['exclusive', 'inclusive']), - ).toBe('2010-07-30T01:00:00 < col ≤ ∞'); expect(formatTimeRange(' : 2020-07-30T00:00:00')).toBe( - '-∞ < col < 2020-07-30', + '-∞ ≤ col < 2020-07-30', ); }); }); diff --git a/superset-frontend/src/explore/controlPanels/sections.tsx b/superset-frontend/src/explore/controlPanels/sections.tsx index 83d2d3a2f69..c1c68ad2f70 100644 --- a/superset-frontend/src/explore/controlPanels/sections.tsx +++ b/superset-frontend/src/explore/controlPanels/sections.tsx @@ -62,15 +62,6 @@ export const datasourceAndVizType: ControlPanelSectionConfig = { description: t('Extra parameters for use in jinja templated queries'), }, }, - { - name: 'time_range_endpoints', - config: { - type: 'HiddenControl', - label: t('Time range endpoints'), - hidden: true, - description: t('Time range endpoints (SIP-15)'), - }, - }, ], ], }; diff --git a/superset-frontend/src/explore/controls.jsx b/superset-frontend/src/explore/controls.jsx index 401bad34e32..2abcd9bb8cc 100644 --- a/superset-frontend/src/explore/controls.jsx +++ b/superset-frontend/src/explore/controls.jsx @@ -348,10 +348,6 @@ export const controls = { "using the engine's local timezone. Note one can explicitly set the timezone " + 'per the ISO 8601 format if specifying either the start and/or end time.', ), - mapStateToProps: ({ form_data: formData }) => ({ - // eslint-disable-next-line camelcase - endpoints: formData?.time_range_endpoints, - }), }, row_limit: { diff --git a/superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx b/superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx index 5dda9167016..7f8c940e325 100644 --- a/superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx +++ b/superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, TimeRangeEndpoint } from '@superset-ui/core'; +import { styled } from '@superset-ui/core'; import React, { useCallback, useEffect } from 'react'; import DateFilterControl from 'src/explore/components/controls/DateFilterControl'; import { NO_TIME_RANGE } from 'src/explore/constants'; @@ -55,11 +55,6 @@ const ControlContainer = styled.div<{ } `; -const endpoints = ['inclusive', 'exclusive'] as [ - TimeRangeEndpoint, - TimeRangeEndpoint, -]; - export default function TimeFilterPlugin(props: PluginFilterTimeProps) { const { setDataMask, @@ -105,7 +100,6 @@ export default function TimeFilterPlugin(props: PluginFilterTimeProps) { onMouseLeave={unsetFocusedFilter} > Dict[str, Any]: + def _process_extras( # pylint: disable=no-self-use + self, extras: Optional[Dict[str, Any]], + ) -> Dict[str, Any]: extras = extras or {} - if self._config["SIP_15_ENABLED"]: - extras["time_range_endpoints"] = self._determine_time_range_endpoints( - extras.get("time_range_endpoints") - ) return extras def _process_row_limit( @@ -117,18 +115,3 @@ class QueryObjectFactory: # pylint: disable=too-few-public-methods # light version of the view.utils.core # import view.utils require application context # Todo: move it and the view.utils.core to utils package - - def _determine_time_range_endpoints( - self, raw_endpoints: Optional[Tuple[str, str]] = None, - ) -> Optional[Tuple[TimeRangeEndpoint, TimeRangeEndpoint]]: - if ( - self._config["SIP_15_GRACE_PERIOD_END"] - and date.today() >= self._config["SIP_15_GRACE_PERIOD_END"] - ): - return TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE - - if raw_endpoints: - start, end = raw_endpoints - return TimeRangeEndpoint(start), TimeRangeEndpoint(end) - - return TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE diff --git a/superset/config.py b/superset/config.py index 86d7b45c471..959be4d89ba 100644 --- a/superset/config.py +++ b/superset/config.py @@ -29,7 +29,7 @@ import os import re import sys from collections import OrderedDict -from datetime import date, timedelta +from datetime import timedelta from typing import Any, Callable, Dict, List, Optional, Type, TYPE_CHECKING, Union import pkg_resources @@ -1258,22 +1258,6 @@ PREVENT_UNSAFE_DB_CONNECTIONS = True # Example: SSL_CERT_PATH = "/certs" SSL_CERT_PATH: Optional[str] = None -# SIP-15 should be enabled for all new Superset deployments which ensures that the time -# range endpoints adhere to [start, end). For existing deployments admins should provide -# a dedicated period of time to allow chart producers to update their charts before -# mass migrating all charts to use the [start, end) interval. -# -# Note if no end date for the grace period is specified then the grace period is -# indefinite. -SIP_15_ENABLED = True -SIP_15_GRACE_PERIOD_END: Optional[date] = None # exclusive -SIP_15_DEFAULT_TIME_RANGE_ENDPOINTS = ["unknown", "inclusive"] -SIP_15_TOAST_MESSAGE = ( - "Action Required: Preview then save your chart using the " - 'new time range endpoints here.' -) - # Turn this key to False to disable ownership check on the old dataset MVC and # datasource API /datasource/save. # diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index 81a53e74dae..9cc2f8a7813 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -301,35 +301,14 @@ class TableColumn(Model, BaseColumn, CertificationMixin): return self.table def get_time_filter( - self, - start_dttm: DateTime, - end_dttm: DateTime, - time_range_endpoints: Optional[ - Tuple[utils.TimeRangeEndpoint, utils.TimeRangeEndpoint] - ], + self, start_dttm: DateTime, end_dttm: DateTime, ) -> ColumnElement: col = self.get_sqla_col(label="__time") l = [] if start_dttm: - l.append( - col - >= self.table.text( - self.dttm_sql_literal(start_dttm, time_range_endpoints) - ) - ) + l.append(col >= self.table.text(self.dttm_sql_literal(start_dttm))) if end_dttm: - if ( - time_range_endpoints - and time_range_endpoints[1] == utils.TimeRangeEndpoint.EXCLUSIVE - ): - l.append( - col - < self.table.text( - self.dttm_sql_literal(end_dttm, time_range_endpoints) - ) - ) - else: - l.append(col <= self.table.text(self.dttm_sql_literal(end_dttm, None))) + l.append(col <= self.table.text(self.dttm_sql_literal(end_dttm))) return and_(*l) def get_timestamp_expression( @@ -368,13 +347,7 @@ class TableColumn(Model, BaseColumn, CertificationMixin): ) return self.table.make_sqla_column_compatible(time_expr, label) - def dttm_sql_literal( - self, - dttm: DateTime, - time_range_endpoints: Optional[ - Tuple[utils.TimeRangeEndpoint, utils.TimeRangeEndpoint] - ], - ) -> str: + def dttm_sql_literal(self, dttm: DateTime) -> str: """Convert datetime object to a SQL expression string""" sql = ( self.db_engine_spec.convert_dttm(self.type, dttm, db_extra=self.db_extra) @@ -387,12 +360,8 @@ class TableColumn(Model, BaseColumn, CertificationMixin): tf = self.python_date_format - # Fallback to the default format (if defined) only if the SIP-15 time range - # endpoints, i.e., [start, end) are enabled. - if not tf and time_range_endpoints == ( - utils.TimeRangeEndpoint.INCLUSIVE, - utils.TimeRangeEndpoint.EXCLUSIVE, - ): + # Fallback to the default format (if defined). + if not tf: tf = self.db_extra.get("python_date_format_by_column_name", {}).get( self.column_name ) @@ -1210,8 +1179,6 @@ class SqlaTable(Model, BaseDatasource): # pylint: disable=too-many-public-metho ) metrics_exprs = [] - time_range_endpoints = extras.get("time_range_endpoints") - if granularity: if granularity not in columns_by_name or not dttm_col: raise QueryObjectValidationError( @@ -1238,12 +1205,10 @@ class SqlaTable(Model, BaseDatasource): # pylint: disable=too-many-public-metho ): time_filters.append( columns_by_name[self.main_dttm_col].get_time_filter( - from_dttm, to_dttm, time_range_endpoints + from_dttm, to_dttm, ) ) - time_filters.append( - dttm_col.get_time_filter(from_dttm, to_dttm, time_range_endpoints) - ) + time_filters.append(dttm_col.get_time_filter(from_dttm, to_dttm)) # Always remove duplicates by column name, as sometimes `metrics_exprs` # can have the same name as a groupby column (e.g. when users use @@ -1450,9 +1415,7 @@ class SqlaTable(Model, BaseDatasource): # pylint: disable=too-many-public-metho if dttm_col and not db_engine_spec.time_groupby_inline: inner_time_filter = [ dttm_col.get_time_filter( - inner_from_dttm or from_dttm, - inner_to_dttm or to_dttm, - time_range_endpoints, + inner_from_dttm or from_dttm, inner_to_dttm or to_dttm, ) ] subq = subq.where(and_(*(where_clause_and + inner_time_filter))) diff --git a/superset/constants.py b/superset/constants.py index 7cfa72e4b36..8399aa457a8 100644 --- a/superset/constants.py +++ b/superset/constants.py @@ -146,7 +146,6 @@ EXTRA_FORM_DATA_OVERRIDE_REGULAR_MAPPINGS = { "time_range": "time_range", "druid_time_origin": "druid_time_origin", "time_grain_sqla": "time_grain_sqla", - "time_range_endpoints": "time_range_endpoints", } EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS = { diff --git a/superset/examples/birth_names.py b/superset/examples/birth_names.py index 722c0e9f44f..830d3980112 100644 --- a/superset/examples/birth_names.py +++ b/superset/examples/birth_names.py @@ -174,7 +174,6 @@ def create_slices(tbl: SqlaTable, admin_owner: bool) -> Tuple[List[Slice], List[ "compare_suffix": "o10Y", "limit": "25", "time_range": "No filter", - "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "ds", "groupby": [], "row_limit": app.config["ROW_LIMIT"], diff --git a/superset/examples/configs/charts/Age_distribution_of_respondents.yaml b/superset/examples/configs/charts/Age_distribution_of_respondents.yaml index 83955a8e306..7b841611bff 100644 --- a/superset/examples/configs/charts/Age_distribution_of_respondents.yaml +++ b/superset/examples/configs/charts/Age_distribution_of_respondents.yaml @@ -31,9 +31,6 @@ params: row_limit: 10000 slice_id: 1380 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: histogram x_axis_label: age diff --git a/superset/examples/configs/charts/Are_you_an_ethnic_minority_in_your_city.yaml b/superset/examples/configs/charts/Are_you_an_ethnic_minority_in_your_city.yaml index 2a8b7ed460a..926de70f92b 100644 --- a/superset/examples/configs/charts/Are_you_an_ethnic_minority_in_your_city.yaml +++ b/superset/examples/configs/charts/Are_you_an_ethnic_minority_in_your_city.yaml @@ -39,9 +39,6 @@ params: show_legend: false slice_id: 1383 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: pie cache_timeout: null diff --git a/superset/examples/configs/charts/Breakdown_of_Developer_Type.yaml b/superset/examples/configs/charts/Breakdown_of_Developer_Type.yaml index 4e4b6881440..83c659aa5f6 100644 --- a/superset/examples/configs/charts/Breakdown_of_Developer_Type.yaml +++ b/superset/examples/configs/charts/Breakdown_of_Developer_Type.yaml @@ -39,9 +39,6 @@ params: table_timestamp_format: smart_date time_grain_sqla: P1D time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: table cache_timeout: null diff --git a/superset/examples/configs/charts/Commute_Time.yaml b/superset/examples/configs/charts/Commute_Time.yaml index 162c3bef0a1..e766189d7cf 100644 --- a/superset/examples/configs/charts/Commute_Time.yaml +++ b/superset/examples/configs/charts/Commute_Time.yaml @@ -50,9 +50,6 @@ params: metrics: metrics row_limit: null time_range: No filter - time_range_endpoints: - - inclusive - - exclusive treemap_ratio: 1.618033988749895 url_params: {} viz_type: treemap diff --git a/superset/examples/configs/charts/Country_of_Citizenship.yaml b/superset/examples/configs/charts/Country_of_Citizenship.yaml index e5ce39f27dc..a5fc6b705c8 100644 --- a/superset/examples/configs/charts/Country_of_Citizenship.yaml +++ b/superset/examples/configs/charts/Country_of_Citizenship.yaml @@ -57,9 +57,6 @@ params: show_bubbles: true slice_id: 1388 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: world_map cache_timeout: null diff --git a/superset/examples/configs/charts/Cross_Channel_Relationship.yaml b/superset/examples/configs/charts/Cross_Channel_Relationship.yaml index 07b4d3dd3aa..dc60805bf0b 100644 --- a/superset/examples/configs/charts/Cross_Channel_Relationship.yaml +++ b/superset/examples/configs/charts/Cross_Channel_Relationship.yaml @@ -49,9 +49,6 @@ params: metric: metrics row_limit: 1000 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive viz_type: chord y_axis_format: SMART_NUMBER cache_timeout: null diff --git a/superset/examples/configs/charts/Cross_Channel_Relationship_heatmap_2786.yaml b/superset/examples/configs/charts/Cross_Channel_Relationship_heatmap_2786.yaml index 24453df8cf0..e08a915f808 100644 --- a/superset/examples/configs/charts/Cross_Channel_Relationship_heatmap_2786.yaml +++ b/superset/examples/configs/charts/Cross_Channel_Relationship_heatmap_2786.yaml @@ -53,9 +53,6 @@ params: sort_x_axis: alpha_asc sort_y_axis: alpha_asc time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: heatmap xscale_interval: null diff --git a/superset/examples/configs/charts/Current_Developers_Is_this_your_first_development_job.yaml b/superset/examples/configs/charts/Current_Developers_Is_this_your_first_development_job.yaml index e051c6a1051..ebe544cc51a 100644 --- a/superset/examples/configs/charts/Current_Developers_Is_this_your_first_development_job.yaml +++ b/superset/examples/configs/charts/Current_Developers_Is_this_your_first_development_job.yaml @@ -54,9 +54,6 @@ params: slice_id: 1361 subheader_font_size: 0.15 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: big_number_total y_axis_format: SMART_NUMBER diff --git a/superset/examples/configs/charts/Degrees_vs_Income.yaml b/superset/examples/configs/charts/Degrees_vs_Income.yaml index 856533f7aef..c2871a6924e 100644 --- a/superset/examples/configs/charts/Degrees_vs_Income.yaml +++ b/superset/examples/configs/charts/Degrees_vs_Income.yaml @@ -69,9 +69,6 @@ params: slice_id: 1376 time_grain_sqla: null time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: box_plot whiskerOptions: Tukey diff --git a/superset/examples/configs/charts/Ethnic_Minority__Gender.yaml b/superset/examples/configs/charts/Ethnic_Minority__Gender.yaml index b5bd7a9df92..5f9449fc308 100644 --- a/superset/examples/configs/charts/Ethnic_Minority__Gender.yaml +++ b/superset/examples/configs/charts/Ethnic_Minority__Gender.yaml @@ -49,9 +49,6 @@ params: metric: metrics row_limit: null time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: sankey cache_timeout: null diff --git a/superset/examples/configs/charts/Filter_Segments.yaml b/superset/examples/configs/charts/Filter_Segments.yaml index e98efd1823c..605e33ca7ee 100644 --- a/superset/examples/configs/charts/Filter_Segments.yaml +++ b/superset/examples/configs/charts/Filter_Segments.yaml @@ -60,9 +60,6 @@ params: queryFields: {} slice_id: 1387 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: filter_box cache_timeout: null diff --git a/superset/examples/configs/charts/Filtering_Vaccines.yaml b/superset/examples/configs/charts/Filtering_Vaccines.yaml index 735349254c9..e458c5a0093 100644 --- a/superset/examples/configs/charts/Filtering_Vaccines.yaml +++ b/superset/examples/configs/charts/Filtering_Vaccines.yaml @@ -45,9 +45,6 @@ params: queryFields: {} slice_id: 3965 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: filter_box cache_timeout: null diff --git a/superset/examples/configs/charts/First_Time_Developer.yaml b/superset/examples/configs/charts/First_Time_Developer.yaml index 35632033c5c..98070520d23 100644 --- a/superset/examples/configs/charts/First_Time_Developer.yaml +++ b/superset/examples/configs/charts/First_Time_Developer.yaml @@ -47,9 +47,6 @@ params: show_legend: false slice_id: 3632 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: pie cache_timeout: null diff --git a/superset/examples/configs/charts/First_Time_Developer__Commute_Time.yaml b/superset/examples/configs/charts/First_Time_Developer__Commute_Time.yaml index 49d7de651bf..b8c7ca54fa0 100644 --- a/superset/examples/configs/charts/First_Time_Developer__Commute_Time.yaml +++ b/superset/examples/configs/charts/First_Time_Developer__Commute_Time.yaml @@ -58,9 +58,6 @@ params: metric: metrics row_limit: 10000 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: sankey cache_timeout: null diff --git a/superset/examples/configs/charts/Games.yaml b/superset/examples/configs/charts/Games.yaml index cfdab3e70b9..6a7112292e7 100644 --- a/superset/examples/configs/charts/Games.yaml +++ b/superset/examples/configs/charts/Games.yaml @@ -67,9 +67,6 @@ params: table_timestamp_format: smart_date time_grain_sqla: P1D time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: table cache_timeout: null diff --git a/superset/examples/configs/charts/Games_per_Genre.yaml b/superset/examples/configs/charts/Games_per_Genre.yaml index 2255622bbd6..6b93863cf76 100644 --- a/superset/examples/configs/charts/Games_per_Genre.yaml +++ b/superset/examples/configs/charts/Games_per_Genre.yaml @@ -84,9 +84,6 @@ params: metrics: metrics row_limit: null time_range: No filter - time_range_endpoints: - - inclusive - - exclusive treemap_ratio: 1.618033988749895 url_params: preselect_filters: '{"1389": {"platform": ["PS", "PS2", "PS3", "PS4"], "genre": diff --git a/superset/examples/configs/charts/Games_per_Genre_over_time.yaml b/superset/examples/configs/charts/Games_per_Genre_over_time.yaml index 6d700d4d423..f3e61d69494 100644 --- a/superset/examples/configs/charts/Games_per_Genre_over_time.yaml +++ b/superset/examples/configs/charts/Games_per_Genre_over_time.yaml @@ -97,9 +97,6 @@ params: slice_id: 3544 time_grain_sqla: null time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: preselect_filters: '{"1389": {"platform": ["PS", "PS2", "PS3", "PS4"], "genre": null, "__time_range": "No filter"}}' diff --git a/superset/examples/configs/charts/Gender.yaml b/superset/examples/configs/charts/Gender.yaml index bfa464ec9ab..bd584ce717d 100644 --- a/superset/examples/configs/charts/Gender.yaml +++ b/superset/examples/configs/charts/Gender.yaml @@ -39,9 +39,6 @@ params: show_legend: false slice_id: 1385 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: pie cache_timeout: null diff --git a/superset/examples/configs/charts/Highest_degree_held.yaml b/superset/examples/configs/charts/Highest_degree_held.yaml index 5e69c9a8008..37cb0d11a1b 100644 --- a/superset/examples/configs/charts/Highest_degree_held.yaml +++ b/superset/examples/configs/charts/Highest_degree_held.yaml @@ -66,9 +66,6 @@ params: table_timestamp_format: smart_date time_grain_sqla: P1D time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: table cache_timeout: null diff --git a/superset/examples/configs/charts/How_do_you_prefer_to_work.yaml b/superset/examples/configs/charts/How_do_you_prefer_to_work.yaml index 41dc453c442..c37c4f0bda1 100644 --- a/superset/examples/configs/charts/How_do_you_prefer_to_work.yaml +++ b/superset/examples/configs/charts/How_do_you_prefer_to_work.yaml @@ -64,9 +64,6 @@ params: sort_x_axis: alpha_asc sort_y_axis: alpha_asc time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: heatmap xscale_interval: null diff --git a/superset/examples/configs/charts/How_much_do_you_expect_to_earn_0_-_100k.yaml b/superset/examples/configs/charts/How_much_do_you_expect_to_earn_0_-_100k.yaml index 6d88f5aee5a..60fe3a03e51 100644 --- a/superset/examples/configs/charts/How_much_do_you_expect_to_earn_0_-_100k.yaml +++ b/superset/examples/configs/charts/How_much_do_you_expect_to_earn_0_-_100k.yaml @@ -87,9 +87,6 @@ params: row_limit: null slice_id: 1366 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: histogram cache_timeout: null diff --git a/superset/examples/configs/charts/Last_Year_Income_Distribution.yaml b/superset/examples/configs/charts/Last_Year_Income_Distribution.yaml index 20ccbb7f051..9d17de60ef4 100644 --- a/superset/examples/configs/charts/Last_Year_Income_Distribution.yaml +++ b/superset/examples/configs/charts/Last_Year_Income_Distribution.yaml @@ -48,9 +48,6 @@ params: groupby: groupby row_limit: null time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: histogram cache_timeout: null diff --git a/superset/examples/configs/charts/Location_of_Current_Developers.yaml b/superset/examples/configs/charts/Location_of_Current_Developers.yaml index 6f16002fd62..3a05331909d 100644 --- a/superset/examples/configs/charts/Location_of_Current_Developers.yaml +++ b/superset/examples/configs/charts/Location_of_Current_Developers.yaml @@ -66,9 +66,6 @@ params: show_bubbles: true slice_id: 3635 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: world_map cache_timeout: null diff --git a/superset/examples/configs/charts/Members_per_Channel.yaml b/superset/examples/configs/charts/Members_per_Channel.yaml index 083355b0ff6..ed308dd6f0c 100644 --- a/superset/examples/configs/charts/Members_per_Channel.yaml +++ b/superset/examples/configs/charts/Members_per_Channel.yaml @@ -32,9 +32,6 @@ params: row_limit: null slice_id: 2396 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive treemap_ratio: 1.618033988749895 url_params: {} viz_type: treemap diff --git a/superset/examples/configs/charts/Messages_per_Channel.yaml b/superset/examples/configs/charts/Messages_per_Channel.yaml index ab32066c171..057ffd14c74 100644 --- a/superset/examples/configs/charts/Messages_per_Channel.yaml +++ b/superset/examples/configs/charts/Messages_per_Channel.yaml @@ -88,9 +88,6 @@ params: stacked_style: stream time_grain_sqla: P1D time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: area x_axis_format: smart_date diff --git a/superset/examples/configs/charts/Most_Dominant_Platforms.yaml b/superset/examples/configs/charts/Most_Dominant_Platforms.yaml index d02491efcd6..12b00279002 100644 --- a/superset/examples/configs/charts/Most_Dominant_Platforms.yaml +++ b/superset/examples/configs/charts/Most_Dominant_Platforms.yaml @@ -67,9 +67,6 @@ params: show_legend: false slice_id: 658 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: pie cache_timeout: null diff --git a/superset/examples/configs/charts/New_Members_per_Month.yaml b/superset/examples/configs/charts/New_Members_per_Month.yaml index 9d565995ea7..84f432a3062 100644 --- a/superset/examples/configs/charts/New_Members_per_Month.yaml +++ b/superset/examples/configs/charts/New_Members_per_Month.yaml @@ -57,9 +57,6 @@ params: subheader_font_size: 0.15 time_grain_sqla: P1M time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: big_number y_axis_format: SMART_NUMBER diff --git a/superset/examples/configs/charts/Number_of_Aspiring_Developers.yaml b/superset/examples/configs/charts/Number_of_Aspiring_Developers.yaml index 80b197dd769..51c1e42f67c 100644 --- a/superset/examples/configs/charts/Number_of_Aspiring_Developers.yaml +++ b/superset/examples/configs/charts/Number_of_Aspiring_Developers.yaml @@ -36,9 +36,6 @@ params: slice_id: 1363 subheader_font_size: 0.15 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: big_number_total y_axis_format: SMART_NUMBER diff --git a/superset/examples/configs/charts/Number_of_Deals_for_each_Combination.yaml b/superset/examples/configs/charts/Number_of_Deals_for_each_Combination.yaml index 73da10044e3..2d47ee5b69e 100644 --- a/superset/examples/configs/charts/Number_of_Deals_for_each_Combination.yaml +++ b/superset/examples/configs/charts/Number_of_Deals_for_each_Combination.yaml @@ -39,9 +39,6 @@ params: sort_x_axis: alpha_asc sort_y_axis: alpha_asc time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: heatmap xscale_interval: null diff --git a/superset/examples/configs/charts/Number_of_Games_That_Hit_100k_in_Sales_By_Release_Year.yaml b/superset/examples/configs/charts/Number_of_Games_That_Hit_100k_in_Sales_By_Release_Year.yaml index 5b542363f34..d6166e4eb10 100644 --- a/superset/examples/configs/charts/Number_of_Games_That_Hit_100k_in_Sales_By_Release_Year.yaml +++ b/superset/examples/configs/charts/Number_of_Games_That_Hit_100k_in_Sales_By_Release_Year.yaml @@ -80,9 +80,6 @@ params: row_limit: 10 slice_id: 661 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive treemap_ratio: 1.618033988749895 url_params: {} viz_type: treemap diff --git a/superset/examples/configs/charts/Number_of_Members.yaml b/superset/examples/configs/charts/Number_of_Members.yaml index 54aded3f5ce..35eba32b618 100644 --- a/superset/examples/configs/charts/Number_of_Members.yaml +++ b/superset/examples/configs/charts/Number_of_Members.yaml @@ -27,9 +27,6 @@ params: subheader: Slack Members subheader_font_size: 0.125 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: big_number_total y_axis_format: SMART_NUMBER diff --git a/superset/examples/configs/charts/Overall_Sales_By_Product_Line.yaml b/superset/examples/configs/charts/Overall_Sales_By_Product_Line.yaml index 5fafb777ef5..82cedd6ff01 100644 --- a/superset/examples/configs/charts/Overall_Sales_By_Product_Line.yaml +++ b/superset/examples/configs/charts/Overall_Sales_By_Product_Line.yaml @@ -59,9 +59,6 @@ params: show_legend: false slice_id: 670 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: pie cache_timeout: null diff --git a/superset/examples/configs/charts/Popular_Genres_Across_Platforms.yaml b/superset/examples/configs/charts/Popular_Genres_Across_Platforms.yaml index a01a18ad00a..a0a111d8dbc 100644 --- a/superset/examples/configs/charts/Popular_Genres_Across_Platforms.yaml +++ b/superset/examples/configs/charts/Popular_Genres_Across_Platforms.yaml @@ -37,9 +37,6 @@ params: sort_x_axis: alpha_asc sort_y_axis: alpha_asc time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: heatmap xscale_interval: null diff --git a/superset/examples/configs/charts/Preferred_Employment_Style.yaml b/superset/examples/configs/charts/Preferred_Employment_Style.yaml index 141321757d0..8626170ab29 100644 --- a/superset/examples/configs/charts/Preferred_Employment_Style.yaml +++ b/superset/examples/configs/charts/Preferred_Employment_Style.yaml @@ -51,9 +51,6 @@ params: row_limit: 10 slice_id: 1377 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive treemap_ratio: 1.618033988749895 url_params: {} viz_type: treemap diff --git a/superset/examples/configs/charts/Proportion_of_Revenue_by_Product_Line.yaml b/superset/examples/configs/charts/Proportion_of_Revenue_by_Product_Line.yaml index fbdac5ed38c..b24afc025d4 100644 --- a/superset/examples/configs/charts/Proportion_of_Revenue_by_Product_Line.yaml +++ b/superset/examples/configs/charts/Proportion_of_Revenue_by_Product_Line.yaml @@ -61,9 +61,6 @@ params: stacked_style: stack time_grain_sqla: P1M time_range: '2003-01-01T00:00:00 : 2005-06-01T00:00:00' - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: area x_axis_format: smart_date diff --git a/superset/examples/configs/charts/Publishers_With_Most_Titles.yaml b/superset/examples/configs/charts/Publishers_With_Most_Titles.yaml index aa93dfa7b86..0cb790545fd 100644 --- a/superset/examples/configs/charts/Publishers_With_Most_Titles.yaml +++ b/superset/examples/configs/charts/Publishers_With_Most_Titles.yaml @@ -46,9 +46,6 @@ params: table_timestamp_format: smart_date time_grain_sqla: P1D time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: table cache_timeout: null diff --git a/superset/examples/configs/charts/Quarterly_Sales.yaml b/superset/examples/configs/charts/Quarterly_Sales.yaml index dc224318ab0..9479fd9d3f9 100644 --- a/superset/examples/configs/charts/Quarterly_Sales.yaml +++ b/superset/examples/configs/charts/Quarterly_Sales.yaml @@ -70,9 +70,6 @@ params: time_compare: null time_grain_sqla: P3M time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: bar x_axis_format: '%m/%d/%Y' diff --git a/superset/examples/configs/charts/Quarterly_Sales_By_Product_Line.yaml b/superset/examples/configs/charts/Quarterly_Sales_By_Product_Line.yaml index 87fd1d61944..35a135e81ab 100644 --- a/superset/examples/configs/charts/Quarterly_Sales_By_Product_Line.yaml +++ b/superset/examples/configs/charts/Quarterly_Sales_By_Product_Line.yaml @@ -73,9 +73,6 @@ params: time_compare: null time_grain_sqla: P3M time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: bar x_axis_format: '%m/%d/%Y' diff --git a/superset/examples/configs/charts/Relocation_ability.yaml b/superset/examples/configs/charts/Relocation_ability.yaml index 82fb80dd2de..3cec3ce4e20 100644 --- a/superset/examples/configs/charts/Relocation_ability.yaml +++ b/superset/examples/configs/charts/Relocation_ability.yaml @@ -47,9 +47,6 @@ params: show_legend: false slice_id: 1365 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: pie cache_timeout: null diff --git a/superset/examples/configs/charts/Revenue_by_Deal_Size.yaml b/superset/examples/configs/charts/Revenue_by_Deal_Size.yaml index 1c57449d1a6..547d1804beb 100644 --- a/superset/examples/configs/charts/Revenue_by_Deal_Size.yaml +++ b/superset/examples/configs/charts/Revenue_by_Deal_Size.yaml @@ -62,9 +62,6 @@ params: show_legend: true time_grain_sqla: P1M time_range: '2003-01-01T00:00:00 : 2005-06-01T00:00:00' - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: bar x_axis_format: smart_date diff --git a/superset/examples/configs/charts/Rise__Fall_of_Video_Game_Consoles.yaml b/superset/examples/configs/charts/Rise__Fall_of_Video_Game_Consoles.yaml index 8b66280a682..1e73b329c91 100644 --- a/superset/examples/configs/charts/Rise__Fall_of_Video_Game_Consoles.yaml +++ b/superset/examples/configs/charts/Rise__Fall_of_Video_Game_Consoles.yaml @@ -114,9 +114,6 @@ params: stacked_style: stream time_grain_sqla: null time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: preselect_filters: '{"1389": {"platform": ["PS", "PS2", "PS3", "PS4"], "genre": null, "__time_range": "No filter"}}' diff --git a/superset/examples/configs/charts/Seasonality_of_Revenue_per_Product_Line.yaml b/superset/examples/configs/charts/Seasonality_of_Revenue_per_Product_Line.yaml index b3161f637f8..3ecd5704ed5 100644 --- a/superset/examples/configs/charts/Seasonality_of_Revenue_per_Product_Line.yaml +++ b/superset/examples/configs/charts/Seasonality_of_Revenue_per_Product_Line.yaml @@ -51,9 +51,6 @@ params: series_height: '25' slice_id: 2811 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: horizon cache_timeout: null diff --git a/superset/examples/configs/charts/Top_10_Games_Proportion_of_Sales_in_Markets.yaml b/superset/examples/configs/charts/Top_10_Games_Proportion_of_Sales_in_Markets.yaml index 99aa034e1cd..d8a80afaedd 100644 --- a/superset/examples/configs/charts/Top_10_Games_Proportion_of_Sales_in_Markets.yaml +++ b/superset/examples/configs/charts/Top_10_Games_Proportion_of_Sales_in_Markets.yaml @@ -122,9 +122,6 @@ params: show_legend: true slice_id: 3546 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: dist_bar x_ticks_layout: staggered diff --git a/superset/examples/configs/charts/Top_15_Languages_Spoken_at_Home.yaml b/superset/examples/configs/charts/Top_15_Languages_Spoken_at_Home.yaml index 138bcc880ea..4143ed4d2e2 100644 --- a/superset/examples/configs/charts/Top_15_Languages_Spoken_at_Home.yaml +++ b/superset/examples/configs/charts/Top_15_Languages_Spoken_at_Home.yaml @@ -48,9 +48,6 @@ params: table_timestamp_format: smart_date time_grain_sqla: P1D time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: table cache_timeout: null diff --git a/superset/examples/configs/charts/Top_Timezones.yaml b/superset/examples/configs/charts/Top_Timezones.yaml index 2e0239ce70f..3879c4a193b 100644 --- a/superset/examples/configs/charts/Top_Timezones.yaml +++ b/superset/examples/configs/charts/Top_Timezones.yaml @@ -42,9 +42,6 @@ params: table_timestamp_format: smart_date time_grain_sqla: P1D time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: table cache_timeout: null diff --git a/superset/examples/configs/charts/Total_Items_Sold.yaml b/superset/examples/configs/charts/Total_Items_Sold.yaml index d02a702c7f6..5ccd733336c 100644 --- a/superset/examples/configs/charts/Total_Items_Sold.yaml +++ b/superset/examples/configs/charts/Total_Items_Sold.yaml @@ -45,9 +45,6 @@ params: subheader: '' subheader_font_size: 0.15 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: big_number_total y_axis_format: SMART_NUMBER diff --git a/superset/examples/configs/charts/Total_Items_Sold_By_Product_Line.yaml b/superset/examples/configs/charts/Total_Items_Sold_By_Product_Line.yaml index 4aae85019de..15334677129 100644 --- a/superset/examples/configs/charts/Total_Items_Sold_By_Product_Line.yaml +++ b/superset/examples/configs/charts/Total_Items_Sold_By_Product_Line.yaml @@ -57,9 +57,6 @@ params: table_timestamp_format: smart_date time_grain_sqla: P1D time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: table cache_timeout: null diff --git a/superset/examples/configs/charts/Total_Revenue.yaml b/superset/examples/configs/charts/Total_Revenue.yaml index a1ae36a49dd..0de8c449f89 100644 --- a/superset/examples/configs/charts/Total_Revenue.yaml +++ b/superset/examples/configs/charts/Total_Revenue.yaml @@ -46,9 +46,6 @@ params: subheader: '' subheader_font_size: 0.15 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: big_number_total y_axis_format: $,.2f diff --git a/superset/examples/configs/charts/Total_Sales_per_Market_Grouped_by_Genre.yaml b/superset/examples/configs/charts/Total_Sales_per_Market_Grouped_by_Genre.yaml index 366c839f7fd..196631386a1 100644 --- a/superset/examples/configs/charts/Total_Sales_per_Market_Grouped_by_Genre.yaml +++ b/superset/examples/configs/charts/Total_Sales_per_Market_Grouped_by_Genre.yaml @@ -168,9 +168,6 @@ params: show_legend: true slice_id: 3548 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: preselect_filters: '{"1389": {"platform": ["PS", "PS2", "PS3", "PS4"], "genre": null, "__time_range": "No filter"}}' diff --git a/superset/examples/configs/charts/Vaccine_Candidates_per_Approach__Stage.yaml b/superset/examples/configs/charts/Vaccine_Candidates_per_Approach__Stage.yaml index 330863bbacc..ac789d3a94b 100644 --- a/superset/examples/configs/charts/Vaccine_Candidates_per_Approach__Stage.yaml +++ b/superset/examples/configs/charts/Vaccine_Candidates_per_Approach__Stage.yaml @@ -37,9 +37,6 @@ params: sort_x_axis: alpha_asc sort_y_axis: alpha_asc time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: heatmap xscale_interval: null diff --git a/superset/examples/configs/charts/Vaccine_Candidates_per_Country.yaml b/superset/examples/configs/charts/Vaccine_Candidates_per_Country.yaml index bef6ec30555..03068ec4bb5 100644 --- a/superset/examples/configs/charts/Vaccine_Candidates_per_Country.yaml +++ b/superset/examples/configs/charts/Vaccine_Candidates_per_Country.yaml @@ -31,9 +31,6 @@ params: metrics: metrics row_limit: 10000 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive treemap_ratio: 1.618033988749895 url_params: {} viz_type: treemap diff --git a/superset/examples/configs/charts/Vaccine_Candidates_per_Country_261.yaml b/superset/examples/configs/charts/Vaccine_Candidates_per_Country_261.yaml index 1218cbb9ec7..b598fb2dbbb 100644 --- a/superset/examples/configs/charts/Vaccine_Candidates_per_Country_261.yaml +++ b/superset/examples/configs/charts/Vaccine_Candidates_per_Country_261.yaml @@ -51,9 +51,6 @@ params: sqlExpression: null show_bubbles: true time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: world_map cache_timeout: null diff --git a/superset/examples/configs/charts/Vaccine_Candidates_per_Country__Stage.yaml b/superset/examples/configs/charts/Vaccine_Candidates_per_Country__Stage.yaml index 88b9d1759f0..81c54e69e33 100644 --- a/superset/examples/configs/charts/Vaccine_Candidates_per_Country__Stage.yaml +++ b/superset/examples/configs/charts/Vaccine_Candidates_per_Country__Stage.yaml @@ -32,9 +32,6 @@ params: row_limit: 10000 slice_id: 3964 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: sunburst cache_timeout: null diff --git a/superset/examples/configs/charts/Vaccine_Candidates_per_Country__Stage_749.yaml b/superset/examples/configs/charts/Vaccine_Candidates_per_Country__Stage_749.yaml index 8fba30fb704..216231b3ec2 100644 --- a/superset/examples/configs/charts/Vaccine_Candidates_per_Country__Stage_749.yaml +++ b/superset/examples/configs/charts/Vaccine_Candidates_per_Country__Stage_749.yaml @@ -33,9 +33,6 @@ params: sort_x_axis: alpha_asc sort_y_axis: alpha_asc time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: heatmap xscale_interval: null diff --git a/superset/examples/configs/charts/Vaccine_Candidates_per_Phase.yaml b/superset/examples/configs/charts/Vaccine_Candidates_per_Phase.yaml index 041033a3f95..22c4d911bd5 100644 --- a/superset/examples/configs/charts/Vaccine_Candidates_per_Phase.yaml +++ b/superset/examples/configs/charts/Vaccine_Candidates_per_Phase.yaml @@ -38,9 +38,6 @@ params: show_legend: false slice_id: 3957 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: pie cache_timeout: null diff --git a/superset/examples/configs/charts/Vaccine_Candidates_per_Phase_587.yaml b/superset/examples/configs/charts/Vaccine_Candidates_per_Phase_587.yaml index fc0d624a518..78070fce7cd 100644 --- a/superset/examples/configs/charts/Vaccine_Candidates_per_Phase_587.yaml +++ b/superset/examples/configs/charts/Vaccine_Candidates_per_Phase_587.yaml @@ -30,9 +30,6 @@ params: row_limit: 10000 show_legend: false time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: dist_bar x_ticks_layout: auto diff --git a/superset/examples/configs/charts/Vehicle_Sales_Filter.yaml b/superset/examples/configs/charts/Vehicle_Sales_Filter.yaml index 4950dc7d0c7..91c8f76bb8d 100644 --- a/superset/examples/configs/charts/Vehicle_Sales_Filter.yaml +++ b/superset/examples/configs/charts/Vehicle_Sales_Filter.yaml @@ -39,9 +39,6 @@ params: queryFields: {} slice_id: 671 time_range: '2003-01-01T00:00:00 : 2005-06-01T00:00:00' - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: filter_box cache_timeout: null diff --git a/superset/examples/configs/charts/Video_Game_Sales_Filter.yaml b/superset/examples/configs/charts/Video_Game_Sales_Filter.yaml index a7f7f4d4310..1136ab25bdd 100644 --- a/superset/examples/configs/charts/Video_Game_Sales_Filter.yaml +++ b/superset/examples/configs/charts/Video_Game_Sales_Filter.yaml @@ -45,9 +45,6 @@ params: granularity_sqla: Year queryFields: {} time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: preselect_filters: '{"1389": {"platform": ["PS", "PS2", "PS3", "PS4"], "genre": null, "__time_range": "No filter"}}' diff --git a/superset/examples/configs/charts/Weekly_Messages.yaml b/superset/examples/configs/charts/Weekly_Messages.yaml index 6b81cb06c41..1f8cfc908fa 100644 --- a/superset/examples/configs/charts/Weekly_Messages.yaml +++ b/superset/examples/configs/charts/Weekly_Messages.yaml @@ -38,9 +38,6 @@ params: subheader_font_size: 0.15 time_grain_sqla: P1W time_range: No filter - time_range_endpoints: - - inclusive - - exclusive time_range_fixed: false url_params: {} viz_type: big_number diff --git a/superset/examples/configs/charts/Weekly_Threads.yaml b/superset/examples/configs/charts/Weekly_Threads.yaml index 28626eb17c0..c875f8e184c 100644 --- a/superset/examples/configs/charts/Weekly_Threads.yaml +++ b/superset/examples/configs/charts/Weekly_Threads.yaml @@ -37,9 +37,6 @@ params: subheader_font_size: 0.15 time_grain_sqla: P1W time_range: '2020-08-05T00:00:00 : 2020-09-06T00:00:00' - time_range_endpoints: - - inclusive - - exclusive time_range_fixed: false url_params: {} viz_type: big_number diff --git a/superset/examples/configs/charts/Work_Location_Preference.yaml b/superset/examples/configs/charts/Work_Location_Preference.yaml index 62f80cb323a..86bb05623f9 100644 --- a/superset/examples/configs/charts/Work_Location_Preference.yaml +++ b/superset/examples/configs/charts/Work_Location_Preference.yaml @@ -47,9 +47,6 @@ params: show_legend: false slice_id: 1370 time_range: No filter - time_range_endpoints: - - inclusive - - exclusive url_params: {} viz_type: pie cache_timeout: null diff --git a/superset/examples/deck.py b/superset/examples/deck.py index a0e32461761..ee01cd7b475 100644 --- a/superset/examples/deck.py +++ b/superset/examples/deck.py @@ -190,7 +190,6 @@ def load_deck_dash() -> None: # pylint: disable=too-many-statements "max_radius": 250, "row_limit": 5000, "time_range": " : ", - "time_range_endpoints": ["inclusive", "exclusive"], "size": "count", "time_grain_sqla": None, "viewport": { diff --git a/superset/examples/world_bank.py b/superset/examples/world_bank.py index 2b3eff97256..0b0473f9323 100644 --- a/superset/examples/world_bank.py +++ b/superset/examples/world_bank.py @@ -161,7 +161,6 @@ def create_slices(tbl: BaseDatasource) -> List[Slice]: "since": "2014-01-01", "until": "2014-01-02", "time_range": "2014-01-01 : 2014-01-02", - "time_range_endpoints": ["inclusive", "exclusive"], "markup_type": "markdown", "country_fieldtype": "cca3", "entity": "country_code", diff --git a/superset/migrations/versions/ab9a9d86e695_deprecate_time_range_endpoints.py b/superset/migrations/versions/ab9a9d86e695_deprecate_time_range_endpoints.py new file mode 100644 index 00000000000..0ce9bd5237d --- /dev/null +++ b/superset/migrations/versions/ab9a9d86e695_deprecate_time_range_endpoints.py @@ -0,0 +1,59 @@ +# 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. +"""deprecate time_range_endpoints + +Revision ID: ab9a9d86e695 +Revises: b5a422d8e252 +Create Date: 2022-02-25 08:06:14.835094 + +""" +import json + +from alembic import op +from sqlalchemy import Column, Integer, Text +from sqlalchemy.ext.declarative import declarative_base + +from superset import db + +# revision identifiers, used by Alembic. +revision = "ab9a9d86e695" +down_revision = "b5a422d8e252" + +Base = declarative_base() + + +class Slice(Base): + __tablename__ = "slices" + id = Column(Integer, primary_key=True) + params = Column(Text) + + +def upgrade(): + bind = op.get_bind() + session = db.Session(bind=bind) + + for slc in session.query(Slice): + params = json.loads(slc.params) + params.pop("time_range_endpoints", None) + slc.params = json.dumps(params) + + session.commit() + session.close() + + +def downgrade(): + pass diff --git a/superset/utils/core.py b/superset/utils/core.py index ddb725623b3..b936b237364 100644 --- a/superset/utils/core.py +++ b/superset/utils/core.py @@ -314,22 +314,6 @@ class RowLevelSecurityFilterType(str, Enum): BASE = "Base" -class TimeRangeEndpoint(str, Enum): - """ - The time range endpoint types which represent inclusive, exclusive, or unknown. - - Unknown represents endpoints which are ill-defined as though the interval may be - [start, end] the filter may behave like (start, end] due to mixed data types and - lexicographical ordering. - - :see: https://github.com/apache/superset/issues/6360 - """ - - EXCLUSIVE = "exclusive" - INCLUSIVE = "inclusive" - UNKNOWN = "unknown" - - class TemporalType(str, Enum): """ Supported temporal types diff --git a/superset/views/core.py b/superset/views/core.py index b4b8365a582..f69ee77bef2 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -28,7 +28,7 @@ import backoff import humanize import pandas as pd import simplejson as json -from flask import abort, flash, g, Markup, redirect, render_template, request, Response +from flask import abort, flash, g, redirect, render_template, request, Response from flask_appbuilder import expose from flask_appbuilder.models.sqla.interface import SQLAInterface from flask_appbuilder.security.decorators import ( @@ -43,7 +43,6 @@ from sqlalchemy.engine.url import make_url from sqlalchemy.exc import ArgumentError, DBAPIError, NoSuchModuleError, SQLAlchemyError from sqlalchemy.orm.session import Session from sqlalchemy.sql import functions as func -from werkzeug.urls import Href from superset import ( app, @@ -769,35 +768,6 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods ) query_context = request.form.get("query_context") - # Flash the SIP-15 message if the slice is owned by the current user and has not - # been updated, i.e., is not using the [start, end) interval. - if ( - config["SIP_15_ENABLED"] - and slc - and g.user in slc.owners - and ( - not form_data.get("time_range_endpoints") - or form_data["time_range_endpoints"] - != ( - utils.TimeRangeEndpoint.INCLUSIVE, - utils.TimeRangeEndpoint.EXCLUSIVE, - ) - ) - ): - url = Href("/superset/explore/")( - { - "form_data": json.dumps( - { - "slice_id": slc.id, - "time_range_endpoints": ( - utils.TimeRangeEndpoint.INCLUSIVE.value, - utils.TimeRangeEndpoint.EXCLUSIVE.value, - ), - } - ) - } - ) - flash(Markup(config["SIP_15_TOAST_MESSAGE"].format(url=url))) try: datasource_id, datasource_type = get_datasource_info( diff --git a/superset/views/utils.py b/superset/views/utils.py index c318c38cbf1..cac0c4f7465 100644 --- a/superset/views/utils.py +++ b/superset/views/utils.py @@ -16,7 +16,6 @@ # under the License. import logging from collections import defaultdict -from datetime import date from functools import wraps from typing import Any, Callable, DefaultDict, Dict, List, Optional, Set, Tuple, Union from urllib import parse @@ -48,7 +47,6 @@ from superset.models.dashboard import Dashboard from superset.models.slice import Slice from superset.models.sql_lab import Query from superset.typing import FormData -from superset.utils.core import TimeRangeEndpoint from superset.utils.decorators import stats_timing from superset.viz import BaseViz @@ -211,12 +209,6 @@ def get_form_data( # pylint: disable=too-many-locals form_data = slice_form_data update_time_range(form_data) - - if app.config["SIP_15_ENABLED"]: - form_data["time_range_endpoints"] = get_time_range_endpoints( - form_data, slc, slice_id - ) - return form_data, slc @@ -302,59 +294,6 @@ def apply_display_max_row_limit( return sql_results -def get_time_range_endpoints( - form_data: FormData, slc: Optional[Slice] = None, slice_id: Optional[int] = None -) -> Optional[Tuple[TimeRangeEndpoint, TimeRangeEndpoint]]: - """ - Get the slice aware time range endpoints from the form-data falling back to the SQL - database specific definition or default if not defined. - - Note under certain circumstances the slice object may not exist, however the slice - ID may be defined which serves as a fallback. - - When SIP-15 is enabled all new slices will use the [start, end) interval. If the - grace period is defined and has ended all slices will adhere to the [start, end) - interval. - - :param form_data: The form-data - :param slc: The slice - :param slice_id: The slice ID - :returns: The time range endpoints tuple - """ - - if ( - app.config["SIP_15_GRACE_PERIOD_END"] - and date.today() >= app.config["SIP_15_GRACE_PERIOD_END"] - ): - return (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE) - - endpoints = form_data.get("time_range_endpoints") - - if (slc or slice_id) and not endpoints: - try: - _, datasource_type = get_datasource_info(None, None, form_data) - except SupersetException: - return None - - if datasource_type == "table": - if not slc: - slc = db.session.query(Slice).filter_by(id=slice_id).one_or_none() - - if slc and slc.datasource: - endpoints = slc.datasource.database.get_extra().get( - "time_range_endpoints" - ) - - if not endpoints: - endpoints = app.config["SIP_15_DEFAULT_TIME_RANGE_ENDPOINTS"] - - if endpoints: - start, end = endpoints - return (TimeRangeEndpoint(start), TimeRangeEndpoint(end)) - - return (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE) - - # see all dashboard components type in # /superset-frontend/src/dashboard/util/componentTypes.js CONTAINER_TYPES = ["COLUMN", "GRID", "TABS", "TAB", "ROW"] diff --git a/superset/viz.py b/superset/viz.py index 3a519bb1f9e..11f052813d0 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -397,7 +397,6 @@ class BaseViz: # pylint: disable=too-many-public-methods "having": self.form_data.get("having", ""), "having_druid": self.form_data.get("having_filters", []), "time_grain_sqla": self.form_data.get("time_grain_sqla"), - "time_range_endpoints": self.form_data.get("time_range_endpoints"), "where": self.form_data.get("where", ""), } diff --git a/tests/common/query_context_generator.py b/tests/common/query_context_generator.py index fe898c89f08..1f87c0cd7cf 100644 --- a/tests/common/query_context_generator.py +++ b/tests/common/query_context_generator.py @@ -19,17 +19,10 @@ import dataclasses from typing import Any, Dict, List, Optional from superset.common.chart_data import ChartDataResultType -from superset.utils.core import AnnotationType, DTTM_ALIAS, TimeRangeEndpoint +from superset.utils.core import AnnotationType, DTTM_ALIAS query_birth_names = { - "extras": { - "where": "", - "time_range_endpoints": ( - TimeRangeEndpoint.INCLUSIVE, - TimeRangeEndpoint.EXCLUSIVE, - ), - "time_grain_sqla": "P1D", - }, + "extras": {"where": "", "time_grain_sqla": "P1D"}, "columns": ["name"], "metrics": [{"label": "sum__num"}], "orderby": [("sum__num", False)], diff --git a/tests/integration_tests/charts/data/api_tests.py b/tests/integration_tests/charts/data/api_tests.py index 6b047217bf1..4f63ad51b65 100644 --- a/tests/integration_tests/charts/data/api_tests.py +++ b/tests/integration_tests/charts/data/api_tests.py @@ -483,16 +483,6 @@ class TestPostChartDataApi(BaseTestChartDataApi): assert rv.status_code == 400 - def test_with_invalid_time_range_endpoints_enum_value__400(self): - self.query_context_payload["queries"][0]["extras"]["time_range_endpoints"] = [ - "abc", - "EXCLUSIVE", - ] - - rv = self.client.post(CHART_DATA_URI, json=self.query_context_payload) - - assert rv.status_code == 400 - def test_with_not_permitted_actor__403(self): """ Chart data API: Test chart data query not allowed @@ -771,12 +761,7 @@ class TestGetChartDataApi(BaseTestChartDataApi): "time_range": "1900-01-01T00:00:00 : 2000-01-01T00:00:00", "granularity": "ds", "filters": [], - "extras": { - "time_range_endpoints": ["inclusive", "exclusive"], - "having": "", - "having_druid": [], - "where": "", - }, + "extras": {"having": "", "having_druid": [], "where": "",}, "applied_time_extras": {}, "columns": ["gender"], "metrics": ["sum__num"], diff --git a/tests/integration_tests/core_tests.py b/tests/integration_tests/core_tests.py index a4c95a20db4..dd8f3a910d7 100644 --- a/tests/integration_tests/core_tests.py +++ b/tests/integration_tests/core_tests.py @@ -336,7 +336,6 @@ class TestCore(SupersetTestCase): "metric": "sum__value", "row_limit": 5000, "slice_id": slice_id, - "time_range_endpoints": ["inclusive", "exclusive"], } # Changing name and save as a new slice resp = self.client.post( @@ -359,7 +358,6 @@ class TestCore(SupersetTestCase): "row_limit": 5000, "slice_id": new_slice_id, "time_range": "now", - "time_range_endpoints": ["inclusive", "exclusive"], } # Setting the name back to its original name by overwriting new slice self.client.post( @@ -1002,7 +1000,6 @@ class TestCore(SupersetTestCase): form_data = { "datasource": f"{tbl_id}__table", "viz_type": "dist_bar", - "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "ds", "time_range": "No filter", "metrics": ["count"], @@ -1026,7 +1023,6 @@ class TestCore(SupersetTestCase): "datasource": f"{tbl_id}__table", "viz_type": "dist_bar", "url_params": {}, - "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "ds", "time_range": 'DATEADD(DATETIME("2021-01-22T00:00:00"), -100, year) : 2021-01-22T00:00:00', "metrics": [ @@ -1125,7 +1121,6 @@ class TestCore(SupersetTestCase): form_data = { "datasource": f"{tbl_id}__table", "viz_type": "dist_bar", - "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "ds", "time_range": "No filter", "metrics": ["count"], @@ -1156,7 +1151,6 @@ class TestCore(SupersetTestCase): form_data = { "datasource": f"{tbl_id}__table", "viz_type": "dist_bar", - "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "ds", "time_range": "No filter", "metrics": ["count"], @@ -1185,7 +1179,6 @@ class TestCore(SupersetTestCase): "form_data": { "datasource": f"{tbl_id}__table", "viz_type": "dist_bar", - "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "ds", "time_range": "No filter", "metrics": ["count"], @@ -1224,7 +1217,6 @@ class TestCore(SupersetTestCase): "form_data": { "datasource": f"{tbl_id}__table", "viz_type": "dist_bar", - "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "ds", "time_range": "No filter", "metrics": ["count"], diff --git a/tests/integration_tests/fixtures/importexport.py b/tests/integration_tests/fixtures/importexport.py index 4ffe0643ef2..3ec3d8f0935 100644 --- a/tests/integration_tests/fixtures/importexport.py +++ b/tests/integration_tests/fixtures/importexport.py @@ -75,7 +75,7 @@ dashboard_export: Dict[str, Any] = { "datasource_name": "birth_names_2", "datasource_type": "table", "id": 83, - "params": '{"adhoc_filters": [], "datasource": "3__table", "granularity_sqla": "ds", "header_font_size": 0.4, "metric": {"aggregate": "SUM", "column": {"column_name": "num_california", "expression": "CASE WHEN state = \'CA\' THEN num ELSE 0 END"}, "expressionType": "SIMPLE", "label": "SUM(num_california)"}, "slice_id": 83, "subheader_font_size": 0.15, "time_range": "100 years ago : now", "time_range_endpoints": ["unknown", "inclusive"], "url_params": {}, "viz_type": "big_number_total", "y_axis_format": "SMART_NUMBER", "remote_id": 83, "datasource_name": "birth_names_2", "schema": null, "database_name": "examples"}', + "params": '{"adhoc_filters": [], "datasource": "3__table", "granularity_sqla": "ds", "header_font_size": 0.4, "metric": {"aggregate": "SUM", "column": {"column_name": "num_california", "expression": "CASE WHEN state = \'CA\' THEN num ELSE 0 END"}, "expressionType": "SIMPLE", "label": "SUM(num_california)"}, "slice_id": 83, "subheader_font_size": 0.15, "time_range": "100 years ago : now", "url_params": {}, "viz_type": "big_number_total", "y_axis_format": "SMART_NUMBER", "remote_id": 83, "datasource_name": "birth_names_2", "schema": null, "database_name": "examples"}', "slice_name": "Number of California Births", "viz_type": "big_number_total", } diff --git a/tests/integration_tests/query_context_tests.py b/tests/integration_tests/query_context_tests.py index 3c72bb31575..b2c9b98ba34 100644 --- a/tests/integration_tests/query_context_tests.py +++ b/tests/integration_tests/query_context_tests.py @@ -30,7 +30,7 @@ from superset.common.query_object import QueryObject from superset.connectors.connector_registry import ConnectorRegistry from superset.connectors.sqla.models import SqlMetric from superset.extensions import cache_manager -from superset.utils.core import AdhocMetricExpressionType, backend, TimeRangeEndpoint +from superset.utils.core import AdhocMetricExpressionType, backend from tests.integration_tests.base_tests import SupersetTestCase from tests.integration_tests.fixtures.birth_names_dashboard import ( load_birth_names_dashboard_with_slices, @@ -235,23 +235,6 @@ class TestQueryContext(SupersetTestCase): cache_key = query_context.query_cache_key(query_object) self.assertNotEqual(cache_key_original, cache_key) - def test_query_context_time_range_endpoints(self): - """ - Ensure that time_range_endpoints are populated automatically when missing - from the payload. - """ - self.login(username="admin") - payload = get_query_context("birth_names") - del payload["queries"][0]["extras"]["time_range_endpoints"] - query_context = ChartDataQueryContextSchema().load(payload) - query_object = query_context.queries[0] - extras = query_object.to_dict()["extras"] - assert "time_range_endpoints" in extras - self.assertEqual( - extras["time_range_endpoints"], - (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE), - ) - def test_handle_metrics_field(self): """ Should support both predefined and adhoc metrics. diff --git a/tests/integration_tests/tasks/async_queries_tests.py b/tests/integration_tests/tasks/async_queries_tests.py index 388185a5485..16299bebea3 100644 --- a/tests/integration_tests/tasks/async_queries_tests.py +++ b/tests/integration_tests/tasks/async_queries_tests.py @@ -128,7 +128,6 @@ class TestAsyncQueries(SupersetTestCase): form_data = { "datasource": f"{table.id}__table", "viz_type": "dist_bar", - "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "ds", "time_range": "No filter", "metrics": ["count"], diff --git a/tests/integration_tests/utils_tests.py b/tests/integration_tests/utils_tests.py index 4bbb1a474fa..b402d82f1fc 100644 --- a/tests/integration_tests/utils_tests.py +++ b/tests/integration_tests/utils_tests.py @@ -66,7 +66,6 @@ from superset.utils.core import ( parse_ssl_cert, parse_js_uri_path_item, split, - TimeRangeEndpoint, validate_json, zlib_compress, zlib_decompress, @@ -74,11 +73,7 @@ from superset.utils.core import ( from superset.utils.database import get_or_create_db from superset.utils import schema from superset.utils.hashing import md5_sha_from_str -from superset.views.utils import ( - build_extra_filters, - get_form_data, - get_time_range_endpoints, -) +from superset.views.utils import build_extra_filters, get_form_data from tests.integration_tests.base_tests import SupersetTestCase from tests.integration_tests.fixtures.world_bank_dashboard import ( load_world_bank_dashboard_with_slices, @@ -744,58 +739,6 @@ class TestUtils(SupersetTestCase): with self.assertRaises(ArgumentError): get_or_create_db("test_db", "yoursql:superset.db/()") - def test_get_time_range_endpoints(self): - self.assertEqual( - get_time_range_endpoints(form_data={}), - (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE), - ) - - self.assertEqual( - get_time_range_endpoints( - form_data={"time_range_endpoints": ["inclusive", "inclusive"]} - ), - (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.INCLUSIVE), - ) - - self.assertEqual( - get_time_range_endpoints(form_data={"datasource": "1_druid"}), - (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE), - ) - - slc = Mock() - slc.datasource.database.get_extra.return_value = {} - - self.assertEqual( - get_time_range_endpoints(form_data={"datasource": "1__table"}, slc=slc), - (TimeRangeEndpoint.UNKNOWN, TimeRangeEndpoint.INCLUSIVE), - ) - - slc.datasource.database.get_extra.return_value = { - "time_range_endpoints": ["inclusive", "inclusive"] - } - - self.assertEqual( - get_time_range_endpoints(form_data={"datasource": "1__table"}, slc=slc), - (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.INCLUSIVE), - ) - - self.assertIsNone(get_time_range_endpoints(form_data={}, slc=slc)) - - with app.app_context(): - app.config["SIP_15_GRACE_PERIOD_END"] = date.today() + timedelta(days=1) - - self.assertEqual( - get_time_range_endpoints(form_data={"datasource": "1__table"}, slc=slc), - (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.INCLUSIVE), - ) - - app.config["SIP_15_GRACE_PERIOD_END"] = date.today() - - self.assertEqual( - get_time_range_endpoints(form_data={"datasource": "1__table"}, slc=slc), - (TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE), - ) - def test_get_iterable(self): self.assertListEqual(get_iterable(123), [123]) self.assertListEqual(get_iterable([123]), [123]) @@ -958,12 +901,6 @@ class TestUtils(SupersetTestCase): def test_get_form_data_default(self) -> None: with app.test_request_context(): form_data, slc = get_form_data() - - self.assertEqual( - form_data, - {"time_range_endpoints": get_time_range_endpoints(form_data={})}, - ) - self.assertEqual(slc, None) def test_get_form_data_request_args(self) -> None: @@ -971,29 +908,13 @@ class TestUtils(SupersetTestCase): query_string={"form_data": json.dumps({"foo": "bar"})} ): form_data, slc = get_form_data() - - self.assertEqual( - form_data, - { - "foo": "bar", - "time_range_endpoints": get_time_range_endpoints(form_data={}), - }, - ) - + self.assertEqual(form_data, {"foo": "bar"}) self.assertEqual(slc, None) def test_get_form_data_request_form(self) -> None: with app.test_request_context(data={"form_data": json.dumps({"foo": "bar"})}): form_data, slc = get_form_data() - - self.assertEqual( - form_data, - { - "foo": "bar", - "time_range_endpoints": get_time_range_endpoints(form_data={}), - }, - ) - + self.assertEqual(form_data, {"foo": "bar"}) self.assertEqual(slc, None) def test_get_form_data_request_form_with_queries(self) -> None: @@ -1005,15 +926,7 @@ class TestUtils(SupersetTestCase): } ): form_data, slc = get_form_data() - - self.assertEqual( - form_data, - { - "url_params": {"foo": "bar"}, - "time_range_endpoints": get_time_range_endpoints(form_data={}), - }, - ) - + self.assertEqual(form_data, {"url_params": {"foo": "bar"}}) self.assertEqual(slc, None) def test_get_form_data_request_args_and_form(self) -> None: @@ -1022,16 +935,7 @@ class TestUtils(SupersetTestCase): query_string={"form_data": json.dumps({"baz": "bar"})}, ): form_data, slc = get_form_data() - - self.assertEqual( - form_data, - { - "baz": "bar", - "foo": "bar", - "time_range_endpoints": get_time_range_endpoints(form_data={}), - }, - ) - + self.assertEqual(form_data, {"baz": "bar", "foo": "bar"}) self.assertEqual(slc, None) def test_get_form_data_globals(self) -> None: @@ -1039,15 +943,7 @@ class TestUtils(SupersetTestCase): g.form_data = {"foo": "bar"} form_data, slc = get_form_data() delattr(g, "form_data") - - self.assertEqual( - form_data, - { - "foo": "bar", - "time_range_endpoints": get_time_range_endpoints(form_data={}), - }, - ) - + self.assertEqual(form_data, {"foo": "bar"}) self.assertEqual(slc, None) def test_get_form_data_corrupted_json(self) -> None: @@ -1056,12 +952,7 @@ class TestUtils(SupersetTestCase): query_string={"form_data": '{"baz": "bar"'}, ): form_data, slc = get_form_data() - - self.assertEqual( - form_data, - {"time_range_endpoints": get_time_range_endpoints(form_data={})}, - ) - + self.assertEqual(form_data, {}) self.assertEqual(slc, None) @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") diff --git a/tests/unit_tests/charts/test_post_processing.py b/tests/unit_tests/charts/test_post_processing.py index e2d0c9c8866..f8586be1ff9 100644 --- a/tests/unit_tests/charts/test_post_processing.py +++ b/tests/unit_tests/charts/test_post_processing.py @@ -1351,7 +1351,6 @@ def test_table(): "table_timestamp_format": "smart_date", "time_grain_sqla": "P1D", "time_range": "No filter", - "time_range_endpoints": ["inclusive", "exclusive"], "url_params": {}, "viz_type": "table", } diff --git a/tests/unit_tests/common/test_query_object_factory.py b/tests/unit_tests/common/test_query_object_factory.py index 4e10fcc3c2d..4fd906f648e 100644 --- a/tests/unit_tests/common/test_query_object_factory.py +++ b/tests/unit_tests/common/test_query_object_factory.py @@ -29,9 +29,7 @@ def create_app_config() -> Dict[str, Any]: "DEFAULT_RELATIVE_START_TIME": "today", "DEFAULT_RELATIVE_END_TIME": "today", "SAMPLES_ROW_LIMIT": 1000, - "SIP_15_ENABLED": True, "SQL_MAX_ROW": 100000, - "SIP_15_GRACE_PERIOD_END": None, }