diff --git a/UPDATING.md b/UPDATING.md index c3d1de14d..df8ab20a4 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 cd4b2f8d1..12bfb342a 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 1d65671bf..86d07ad82 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 f4a6f9df4..b06c1b3ce 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 1c99593ad..17c9e5042 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 1c9ea8d8d..8163dd97d 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 2f8584199..4a3fe5ff5 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 835dde799..aea2881b2 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 41708d9dc..c9961cc7c 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 e799f7ccc..f23ed2858 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 614cc02b5..820c3f1a3 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 defcb8098..ca6ab730d 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 e3d446a76..eb37db016 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 27abbd396..b1a2efc7b 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 c5a19de74..945cb0025 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 d698c9214..b873d0f44 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 1ebba4619..3adaecc65 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 bae1d8f1f..82ed0dd8a 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 380285b81..9905d8f5c 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 47077f61c..54856ff78 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 2033d3368..3cfaf77e7 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 ef07ea3b7..f9cdca027 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 80f287295..ee979a1c7 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 8ad5f1d8d..fc14dd985 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 012aab606..3a0debfec 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 83d2d3a2f..c1c68ad2f 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 401bad34e..2abcd9bb8 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 5dda91670..7f8c940e3 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 86d7b45c4..959be4d89 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 81a53e74d..9cc2f8a78 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 7cfa72e4b..8399aa457 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 722c0e9f4..830d39801 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 83955a8e3..7b841611b 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 2a8b7ed46..926de70f9 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 4e4b68814..83c659aa5 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 162c3bef0..e766189d7 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 e5ce39f27..a5fc6b705 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 07b4d3dd3..dc60805bf 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 24453df8c..e08a915f8 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 e051c6a10..ebe544cc5 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 856533f7a..c2871a692 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 b5bd7a9df..5f9449fc3 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 e98efd182..605e33ca7 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 735349254..e458c5a00 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 35632033c..98070520d 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 49d7de651..b8c7ca54f 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 cfdab3e70..6a7112292 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 2255622bb..6b93863cf 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 6d700d4d4..f3e61d694 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 bfa464ec9..bd584ce71 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 5e69c9a80..37cb0d11a 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 41dc453c4..c37c4f0bd 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 6d88f5aee..60fe3a03e 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 20ccbb7f0..9d17de60e 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 6f16002fd..3a0533190 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 083355b0f..ed308dd6f 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 ab32066c1..057ffd14c 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 d02491efc..12b002790 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 9d565995e..84f432a30 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 80b197dd7..51c1e42f6 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 73da10044..2d47ee5b6 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 5b542363f..d6166e4eb 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 54aded3f5..35eba32b6 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 5fafb777e..82cedd6ff 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 a01a18ad0..a0a111d8d 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 141321757..8626170ab 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 fbdac5ed3..b24afc025 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 aa93dfa7b..0cb790545 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 dc224318a..9479fd9d3 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 87fd1d619..35a135e81 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 82fb80dd2..3cec3ce4e 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 1c57449d1..547d1804b 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 8b66280a6..1e73b329c 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 b3161f637..3ecd5704e 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 99aa034e1..d8a80afae 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 138bcc880..4143ed4d2 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 2e0239ce7..3879c4a19 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 d02a702c7..5ccd73333 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 4aae85019..153346771 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 a1ae36a49..0de8c449f 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 366c839f7..196631386 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 330863bba..ac789d3a9 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 bef6ec305..03068ec4b 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 1218cbb9e..b598fb2db 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 88b9d1759..81c54e69e 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 8fba30fb7..216231b3e 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 041033a3f..22c4d911b 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 fc0d624a5..78070fce7 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 4950dc7d0..91c8f76bb 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 a7f7f4d43..1136ab25b 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 6b81cb06c..1f8cfc908 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 28626eb17..c875f8e18 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 62f80cb32..86bb05623 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 a0e324617..ee01cd7b4 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 2b3eff972..0b0473f93 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 000000000..0ce9bd523 --- /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 ddb725623..b936b2373 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 b4b8365a5..f69ee77be 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 c318c38cb..cac0c4f74 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 3a519bb1f..11f052813 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 fe898c89f..1f87c0cd7 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 6b047217b..4f63ad51b 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 a4c95a20d..dd8f3a910 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 4ffe0643e..3ec3d8f09 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 3c72bb315..b2c9b98ba 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 388185a54..16299bebe 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 4bbb1a474..b402d82f1 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 e2d0c9c88..f8586be1f 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 4e10fcc3c..4fd906f64 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, }