Skip to content

Commit

Permalink
Merge branch 'master' into arash.afghahi/sc-46372/remove-native-druid…
Browse files Browse the repository at this point in the history
…-nosql-from-the-codebase
  • Loading branch information
AAfghahi committed Jul 7, 2022
2 parents 460cbdf + 4bfa622 commit 4be9f7e
Show file tree
Hide file tree
Showing 96 changed files with 1,189 additions and 353 deletions.
1 change: 1 addition & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ assists people when migrating to a new version.
- [18936](https://github.com/apache/superset/pull/18936): Removes legacy SIP-15 interim 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.
- [19570](https://github.com/apache/superset/pull/19570): makes [sqloxide](https://pypi.org/project/sqloxide/) optional so the SIP-68 migration can be run on aarch64. If the migration is taking too long installing sqloxide manually should improve the performance.
- [20170](https://github.com/apache/superset/pull/20170): Introduced a new endpoint for getting datasets samples.
- [20606](https://github.com/apache/superset/pull/20606): When user clicks on chart title or "Edit chart" button in Dashboard page, Explore opens in the same tab. Clicking while holding cmd/ctrl opens Explore in a new tab. To bring back the old behaviour (always opening Explore in a new tab), flip feature flag `DASHBOARD_EDIT_CHART_IN_NEW_TAB` to `True`.

### Breaking Changes

Expand Down
4 changes: 4 additions & 0 deletions docs/docs/installation/configuring-superset.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ Make sure the pip package [`Authlib`](https://authlib.org/) is installed on the
First, configure authorization in Superset `superset_config.py`.

```python
from flask_appbuilder.security.manager import AUTH_OAUTH

# Set the authentication type to OAuth
AUTH_TYPE = AUTH_OAUTH

OAUTH_PROVIDERS = [
{ 'name':'egaSSO',
'token_key':'access_token', # Name of the token in the response of access_token_url
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/installation/running-on-kubernetes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ configOverrides:
# This will make sure the redirect_uri is properly computed, even with SSL offloading
ENABLE_PROXY_FIX = True
from flask_appbuilder.security.manager import (AUTH_OAUTH, AUTH_DB)
from flask_appbuilder.security.manager import AUTH_OAUTH
AUTH_TYPE = AUTH_OAUTH
OAUTH_PROVIDERS = [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ geospatial charts.

Here are a **few different ways you can get started with Superset**:

- Download the [source from Apache Foundation's website](https://dist.apache.org/repos/dist/release/superset/1.4.1/)
- Download the [source from Apache Foundation's website](https://dist.apache.org/repos/dist/release/superset/)
- Download the latest Superset version from [Pypi here](https://pypi.org/project/apache-superset/)
- Setup Superset locally with one command
using [Docker Compose](installation/installing-superset-using-docker-compose)
Expand Down
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ maintainers:
- name: craig-rueda
email: [email protected]
url: https://github.com/craig-rueda
version: 0.6.3
version: 0.6.4
dependencies:
- name: postgresql
version: 11.1.22
Expand Down
3 changes: 3 additions & 0 deletions helm/superset/templates/deployment-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ spec:
{{- end }}
securityContext:
runAsUser: {{ .Values.runAsUser }}
{{- if .Values.supersetCeleryBeat.securityContext }}
{{ toYaml .Values.supersetCeleryBeat.securityContext | nindent 8 }}
{{- end }}
{{- if .Values.supersetCeleryBeat.initContainers }}
initContainers:
{{- tpl (toYaml .Values.supersetCeleryBeat.initContainers) . | nindent 6 }}
Expand Down
3 changes: 3 additions & 0 deletions helm/superset/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ spec:
{{- end }}
securityContext:
runAsUser: {{ .Values.runAsUser }}
{{- if .Values.supersetWorker.securityContext }}
{{ toYaml .Values.supersetWorker.securityContext | nindent 8 }}
{{- end }}
{{- if .Values.supersetWorker.initContainers }}
initContainers:
{{- tpl (toYaml .Values.supersetWorker.initContainers) . | nindent 6 }}
Expand Down
3 changes: 3 additions & 0 deletions helm/superset/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ spec:
{{- end }}
securityContext:
runAsUser: {{ .Values.runAsUser }}
{{- if .Values.supersetNode.securityContext }}
{{ toYaml .Values.supersetNode.securityContext | nindent 8 }}
{{- end }}
{{- if .Values.supersetNode.initContainers }}
initContainers:
{{- tpl (toYaml .Values.supersetNode.initContainers) . | nindent 6 }}
Expand Down
3 changes: 3 additions & 0 deletions helm/superset/templates/init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ spec:
{{- end }}
securityContext:
runAsUser: {{ .Values.runAsUser }}
{{- if .Values.init.securityContext }}
{{ toYaml .Values.init.securityContext | nindent 8 }}
{{- end }}
{{- if .Values.init.initContainers }}
initContainers:
{{- tpl (toYaml .Values.init.initContainers) . | nindent 6 }}
Expand Down
12 changes: 12 additions & 0 deletions helm/superset/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@
},
"resources": {
"type": "object"
},
"securityContext": {
"type": "object"
}
},
"required": [
Expand Down Expand Up @@ -311,6 +314,9 @@
},
"resources": {
"type": "object"
},
"securityContext": {
"type": "object"
}
},
"required": [
Expand Down Expand Up @@ -345,6 +351,9 @@
},
"resources": {
"type": "object"
},
"securityContext": {
"type": "object"
}
},
"required": [
Expand Down Expand Up @@ -408,6 +417,9 @@
},
"podAnnotations": {
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/annotations"
},
"securityContext": {
"type": "object"
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ supersetNode:
# requests:
# cpu: 100m
# memory: 128Mi
securityContext: {}
##
## Superset worker configuration
supersetWorker:
Expand Down Expand Up @@ -293,6 +294,7 @@ supersetWorker:
# requests:
# cpu: 100m
# memory: 128Mi
securityContext: {}
##
## Superset beat configuration (to trigger scheduled jobs like reports)
supersetCeleryBeat:
Expand Down Expand Up @@ -325,6 +327,7 @@ supersetCeleryBeat:
# requests:
# cpu: 100m
# memory: 128Mi
securityContext: {}
##
## Init job configuration
init:
Expand Down Expand Up @@ -388,6 +391,7 @@ init:
fi
## Annotations to be added to init job pods
podAnnotations: {}
securityContext: {}
##
## Configuration values for the postgresql dependency.
## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ flask==2.0.3
# flask-migrate
# flask-sqlalchemy
# flask-wtf
flask-appbuilder==4.1.2
flask-appbuilder==4.1.3
# via apache-superset
flask-babel==1.0.0
# via flask-appbuilder
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_git_sha() -> str:
"cryptography>=3.3.2",
"deprecation>=2.1.0, <2.2.0",
"flask>=2.0.0, <3.0.0",
"flask-appbuilder>=4.1.2, <5.0.0",
"flask-appbuilder>=4.1.3, <5.0.0",
"flask-caching>=1.10.0",
"flask-compress",
"flask-talisman",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Advanced analytics', () => {
cy.intercept('POST', '/superset/explore_json/**').as('postJson');
cy.intercept('GET', '/superset/explore_json/**').as('getJson');
cy.intercept('PUT', '/api/v1/explore/**').as('putExplore');
cy.intercept('GET', '/superset/explore/**').as('getExplore');
cy.intercept('GET', '/explore/**').as('getExplore');
});

it('Create custom time compare', () => {
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/cypress-base/cypress/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import '@cypress/code-coverage/support';
import '@applitools/eyes-cypress/commands';

const BASE_EXPLORE_URL = '/superset/explore/?form_data=';
const BASE_EXPLORE_URL = '/explore/?form_data=';
const TokenName = Cypress.env('TOKEN_NAME');

require('cy-verify-downloads').addCustomCommand();
Expand Down Expand Up @@ -90,7 +90,7 @@ Cypress.Commands.add(
},
}).then(response => {
const formDataKey = response.body.key;
const url = `/superset/explore/?form_data_key=${formDataKey}`;
const url = `/explore/?form_data_key=${formDataKey}`;
cy.visit(url);
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export type SharedColumnConfigProp =
| 'd3SmallNumberFormat'
| 'd3TimeFormat'
| 'horizontalAlign'
| 'truncateLongCells'
| 'showCellBars';

const emitTarget: ControlFormItemSpec<'Input'> = {
Expand Down Expand Up @@ -142,6 +143,14 @@ const colorPositiveNegative: ControlFormItemSpec<'Checkbox'> = {
debounceDelay: 200,
};

const truncateLongCells: ControlFormItemSpec<'Checkbox'> = {
controlType: 'Checkbox',
label: t('Truncate Cells'),
description: t('Truncate long cells to the "min width" set above'),
defaultValue: false,
debounceDelay: 400,
};

/**
* All configurable column formatting properties.
*/
Expand All @@ -159,6 +168,7 @@ export const SHARED_COLUMN_CONFIG_PROPS = {
d3TimeFormat,
fractionDigits,
columnWidth,
truncateLongCells,
horizontalAlign,
showCellBars,
alignPositiveNegative,
Expand All @@ -175,6 +185,7 @@ export const DEFAULT_CONFIG_FORM_LAYOUT: ColumnConfigFormLayout = {
'columnWidth',
{ name: 'horizontalAlign', override: { defaultValue: 'left' } },
],
['truncateLongCells'],
],
[GenericDataType.NUMERIC]: [
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { QueryObject } from './types';
import {
ExtraFormDataAppend,
ExtraFormDataOverrideExtras,
ExtraFormDataOverrideRegular,
ExtraFormDataOverride,
} from './types/QueryFormData';
QueryObject,
} from './types';

/**
* Licensed to the Apache Software Foundation (ASF) under one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,37 @@ import React from 'react';
import { TypedRegistry } from '../models';
import { makeSingleton } from '../utils';

/** A function (or component) which returns text (or marked-up text) */
type UiGeneratorText<P = void> = (props: P) => string | React.ReactElement;
/**
* A function which returns text (or marked-up text)
* If what you want is a react component, don't use this. Use React.ComponentType instead.
*/
type ReturningDisplayable<P = void> = (props: P) => string | React.ReactElement;

/**
* This type defines all the UI override options which replace elements of Superset's default UI.
* Idea with the keys here is generally to namespace following the form of 'domain.functonality.item'
* This type defines all available extensions of Superset's default UI.
* Namespace the keys here to follow the form of 'some_domain.functonality.item'.
* Take care to name your keys well, as the name describes what this extension point's role is in Superset.
*
* When defining a new option here, take care to keep any parameters to functions (or components) minimal.
* Any removal or alteration to a parameter will be considered a breaking change.
*/
export type UiOverrides = Partial<{
'embedded.documentation.description': UiGeneratorText;
export type Extensions = Partial<{
'embedded.documentation.description': ReturningDisplayable;
'embedded.documentation.url': string;
'navbar.right': React.ComponentType;
'welcome.banner': React.ComponentType;
}>;

/**
* A registry containing UI customizations to replace elements of Superset's default UI.
* A registry containing extensions which can alter Superset's UI at specific points defined by Superset.
* See SIP-87: https://github.com/apache/superset/issues/20615
*/
class UiOverrideRegistry extends TypedRegistry<UiOverrides> {
name = 'UiOverrideRegistry';
class ExtensionsRegistry extends TypedRegistry<Extensions> {
name = 'ExtensionsRegistry';
}

export const getUiOverrideRegistry = makeSingleton(UiOverrideRegistry, {});
export const getExtensionsRegistry = makeSingleton(ExtensionsRegistry, {});

// Exporting this under the old name for backwards compatibility.
// After downstream folks have migrated to `getExtensionsRegistry`, we should remove this.
export const getUiOverrideRegistry = getExtensionsRegistry;
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export * from './UiOverrideRegistry';
export * from './ExtensionsRegistry';
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export enum FeatureFlag {
UX_BETA = 'UX_BETA',
GENERIC_CHART_AXES = 'GENERIC_CHART_AXES',
USE_ANALAGOUS_COLORS = 'USE_ANALAGOUS_COLORS',
DASHBOARD_EDIT_CHART_IN_NEW_TAB = 'DASHBOARD_EDIT_CHART_IN_NEW_TAB',
}
export type ScheduleQueriesProps = {
JSONSCHEMA: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import { getUiOverrideRegistry } from '@superset-ui/core';
import { getExtensionsRegistry } from '@superset-ui/core';

test('should get instance of getUiOverrideRegistry', () => {
expect(getUiOverrideRegistry().name).toBe('UiOverrideRegistry');
test('should get instance of getExtensionsRegistry', () => {
expect(getExtensionsRegistry().name).toBe('ExtensionsRegistry');
});
11 changes: 11 additions & 0 deletions superset-frontend/plugins/plugin-chart-table/src/Styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ export default styled.div`
float: right;
}
.dt-truncate-cell {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dt-truncate-cell:hover {
overflow: visible;
white-space: normal;
height: auto;
}
.dt-pagination {
text-align: right;
/* use padding instead of margin so clientHeight can capture it */
Expand Down
29 changes: 28 additions & 1 deletion superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ export default function TableChart<D extends DataRecord = DataRecord>(
? defaultColorPN
: config.colorPositiveNegative;

const { truncateLongCells } = config;

const hasColumnColorFormatters =
isNumeric &&
Array.isArray(columnColorFormatters) &&
Expand Down Expand Up @@ -411,12 +413,37 @@ export default function TableChart<D extends DataRecord = DataRecord>(
].join(' '),
};
if (html) {
if (truncateLongCells) {
// eslint-disable-next-line react/no-danger
return (
<StyledCell {...cellProps}>
<div
className="dt-truncate-cell"
style={columnWidth ? { width: columnWidth } : undefined}
dangerouslySetInnerHTML={html}
/>
</StyledCell>
);
}
// eslint-disable-next-line react/no-danger
return <StyledCell {...cellProps} dangerouslySetInnerHTML={html} />;
}
// If cellProps renderes textContent already, then we don't have to
// render `Cell`. This saves some time for large tables.
return <StyledCell {...cellProps}>{text}</StyledCell>;
return (
<StyledCell {...cellProps}>
{truncateLongCells ? (
<div
className="dt-truncate-cell"
style={columnWidth ? { width: columnWidth } : undefined}
>
{text}
</div>
) : (
text
)}
</StyledCell>
);
},
Header: ({ column: col, onClick, style, onDragStart, onDrop }) => (
<th
Expand Down
Loading

0 comments on commit 4be9f7e

Please sign in to comment.