Skip to content

Commit

Permalink
Merge branch 'master' into chore/bump-polyline-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneTorap committed Apr 28, 2023
2 parents 1264aee + dab038c commit 4562e1e
Show file tree
Hide file tree
Showing 38 changed files with 567 additions and 180 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ecs-task-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
{
"name": "SUPERSET_PORT",
"value": "8080"
},
{
"name": "SUPERSET_SECRET_KEY",
"value": "super-secret-for-ephemerals"
}
],
"mountPoints": [],
Expand Down
2 changes: 1 addition & 1 deletion docker/pythonpath_dev/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_env_variable(var_name: str, default: Optional[str] = None) -> str:
RESULTS_BACKEND = FileSystemCache("/app/superset_home/sqllab")

CACHE_CONFIG = {
"CACHE_TYPE": "redis",
"CACHE_TYPE": "RedisCache",
"CACHE_DEFAULT_TIMEOUT": 300,
"CACHE_KEY_PREFIX": "superset_",
"CACHE_REDIS_HOST": REDIS_HOST,
Expand Down
3 changes: 1 addition & 2 deletions docs/docs/installation/running-on-kubernetes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ connect to those datasources in your Superset installation:
```yaml
bootstrapScript: |
#!/bin/bash
pip install psycopg2==2.9.1 \
redis==3.2.1 \
pip install psycopg2==2.9.6 \
sqlalchemy-bigquery==1.5.0 \
elasticsearch-dbapi==0.2.5 &&\
if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi
Expand Down
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ maintainers:
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
version: 0.9.2
version: 0.9.3
dependencies:
- name: postgresql
version: 12.1.6
Expand Down
2 changes: 1 addition & 1 deletion helm/superset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NOTE: This file is generated by helm-docs: https://github.com/norwoodj/helm-docs

# superset

![Version: 0.9.2](https://img.shields.io/badge/Version-0.9.2-informational?style=flat-square)
![Version: 0.9.3](https://img.shields.io/badge/Version-0.9.3-informational?style=flat-square)

Apache Superset is a modern, enterprise-ready business intelligence web application

Expand Down
2 changes: 1 addition & 1 deletion helm/superset/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def env(key, default=None):

MAPBOX_API_KEY = env('MAPBOX_API_KEY', '')
CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 300,
'CACHE_KEY_PREFIX': 'superset_',
'CACHE_REDIS_HOST': env('REDIS_HOST'),
Expand Down
4 changes: 3 additions & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ amqp==5.1.0
# via kombu
apispec[yaml]==3.3.2
# via flask-appbuilder
async-timeout==4.0.2
# via redis
attrs==21.2.0
# via jsonschema
babel==2.9.1
Expand Down Expand Up @@ -251,7 +253,7 @@ pyyaml==5.4.1
# via
# apache-superset
# apispec
redis==3.5.3
redis==4.5.4
# via apache-superset
rich==13.3.1
# via flask-limiter
Expand Down
2 changes: 1 addition & 1 deletion requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pillow==9.3.0
# via apache-superset
progress==1.6
# via -r requirements/development.in
psycopg2-binary==2.9.5
psycopg2-binary==2.9.6
# via apache-superset
ptyprocess==0.7.0
# via pexpect
Expand Down
2 changes: 1 addition & 1 deletion requirements/docker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gevent==21.8.0
# via -r requirements/docker.in
greenlet==1.1.3.post0
# via gevent
psycopg2-binary==2.9.5
psycopg2-binary==2.9.6
# via apache-superset
zope-event==4.5.0
# via gevent
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_git_sha() -> str:
"pyarrow>=10.0.1, <11",
"pyyaml>=5.4",
"PyJWT>=2.4.0, <3.0",
"redis",
"redis>=4.5.4, <5.0",
"selenium>=3.141.0",
"shortid",
"sshtunnel>=0.4.0, <0.5",
Expand Down Expand Up @@ -170,7 +170,7 @@ def get_git_sha() -> str:
],
"oracle": ["cx-Oracle>8.0.0, <8.1"],
"pinot": ["pinotdb>=0.3.3, <0.4"],
"postgres": ["psycopg2-binary==2.9.5"],
"postgres": ["psycopg2-binary==2.9.6"],
"presto": ["pyhive[presto]>=0.6.5"],
"trino": ["trino>=0.319.0"],
"prophet": ["prophet>=1.0.1, <1.1", "pystan<3.0"],
Expand Down
5 changes: 4 additions & 1 deletion superset-frontend/cypress-base/cypress/e2e/explore/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export function interceptExploreJson() {
}

export function interceptExploreGet() {
cy.intercept('GET', `/api/v1/explore/?slice_id=**`).as('getExplore');
cy.intercept({
method: 'GET',
url: /api\/v1\/explore\/\?(form_data_key|dashboard_page_id|slice_id)=.*/,
}).as('getExplore');
}

export function setFilter(filter: string, option: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,6 @@ export default function transformProps(
selectedValues,
onContextMenu,
refs,
coltypeMapping,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
import {
extractGroupbyLabel,
getChartPadding,
getColtypesMapping,
getLegendProps,
sanitizeHtml,
} from '../utils/series';
Expand Down Expand Up @@ -95,7 +96,7 @@ export default function transformProps(
emitCrossFilters,
} = chartProps;
const data: DataRecord[] = queriesData[0].data || [];

const coltypeMapping = getColtypesMapping(queriesData[0]);
const {
colorScheme,
groupby,
Expand Down Expand Up @@ -244,5 +245,6 @@ export default function transformProps(
selectedValues,
onContextMenu,
refs,
coltypeMapping,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
import { OpacityEnum } from '../constants';
import { getDefaultTooltip } from '../utils/tooltip';
import { Refs } from '../types';
import { getColtypesMapping } from '../utils/series';

const setIntervalBoundsAndColors = (
intervals: string,
Expand Down Expand Up @@ -130,6 +131,7 @@ export default function transformProps(
}: EchartsGaugeFormData = { ...DEFAULT_GAUGE_FORM_DATA, ...formData };
const refs: Refs = {};
const data = (queriesData[0]?.data || []) as DataRecord[];
const coltypeMapping = getColtypesMapping(queriesData[0]);
const numberFormatter = getNumberFormatter(numberFormat);
const colorFn = CategoricalColorNamespace.getScale(colorScheme as string);
const axisLineWidth = calculateAxisLineWidth(data, fontSize, overlap);
Expand Down Expand Up @@ -341,5 +343,6 @@ export default function transformProps(
selectedValues: filterState.selectedValues || [],
onContextMenu,
refs,
coltypeMapping,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@
* under the License.
*/
import React from 'react';
import {
getColumnLabel,
getNumberFormatter,
getTimeFormatter,
} from '@superset-ui/core';
import { EventHandlers } from '../types';
import Echart from '../components/Echart';
import { GraphChartTransformedProps } from './types';
import { formatSeriesName } from '../utils/series';

type DataRow = {
source?: string;
Expand All @@ -46,6 +52,7 @@ export default function EchartsGraph({
filterState,
emitCrossFilters,
refs,
coltypeMapping,
}: GraphChartTransformedProps) {
const getCrossFilterDataMask = (node: DataRow | undefined) => {
if (!node?.name || !node?.col) {
Expand Down Expand Up @@ -143,7 +150,18 @@ export default function EchartsGraph({
drillToDetail: drillToDetailFilters,
crossFilter: getCrossFilterDataMask(node),
drillBy: node && {
filters: [{ col: node.col, op: '==', val: node.name }],
filters: [
{
col: node.col,
op: '==',
val: node.name,
formattedVal: formatSeriesName(node.name, {
timeFormatter: getTimeFormatter(formData.dateFormat),
numberFormatter: getNumberFormatter(formData.numberFormat),
coltype: coltypeMapping?.[getColumnLabel(node.col)],
}),
},
],
groupbyFieldName:
node.col === formData.source ? 'source' : 'target',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ import {
EchartsGraphChartProps,
} from './types';
import { DEFAULT_GRAPH_SERIES_OPTION } from './constants';
import { getChartPadding, getLegendProps, sanitizeHtml } from '../utils/series';
import {
getChartPadding,
getColtypesMapping,
getLegendProps,
sanitizeHtml,
} from '../utils/series';
import { getDefaultTooltip } from '../utils/tooltip';
import { Refs } from '../types';

Expand Down Expand Up @@ -174,7 +179,7 @@ export default function transformProps(
theme,
} = chartProps;
const data: DataRecord[] = queriesData[0].data || [];

const coltypeMapping = getColtypesMapping(queriesData[0]);
const {
source,
target,
Expand Down Expand Up @@ -343,5 +348,6 @@ export default function transformProps(
filterState,
refs,
emitCrossFilters,
coltypeMapping,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
import React, { useCallback } from 'react';
import {
AxisType,
DataRecordValue,
DTTM_ALIAS,
BinaryQueryObjectFilterClause,
DTTM_ALIAS,
DataRecordValue,
getColumnLabel,
getNumberFormatter,
getTimeFormatter,
} from '@superset-ui/core';
import { EchartsMixedTimeseriesChartTransformedProps } from './types';
import Echart from '../components/Echart';
import { EventHandlers } from '../types';
import { currentSeries } from '../utils/series';
import { currentSeries, formatSeriesName } from '../utils/series';

export default function EchartsMixedTimeseries({
height,
Expand All @@ -45,6 +48,7 @@ export default function EchartsMixedTimeseries({
xValueFormatter,
xAxis,
refs,
coltypeMapping,
}: EchartsMixedTimeseriesChartTransformedProps) {
const isFirstQuery = useCallback(
(seriesIndex: number) => seriesIndex < seriesBreakdown,
Expand Down Expand Up @@ -125,7 +129,7 @@ export default function EchartsMixedTimeseries({
mouseover: params => {
currentSeries.name = params.seriesName;
},
contextmenu: eventParams => {
contextmenu: async eventParams => {
if (onContextMenu) {
eventParams.event.stop();
const { data, seriesName, seriesIndex } = eventParams;
Expand Down Expand Up @@ -167,6 +171,11 @@ export default function EchartsMixedTimeseries({
col: dimension,
op: '==',
val: values[i],
formattedVal: formatSeriesName(values[i], {
timeFormatter: getTimeFormatter(formData.dateFormat),
numberFormatter: getNumberFormatter(formData.numberFormat),
coltype: coltypeMapping?.[getColumnLabel(dimension)],
}),
}),
);
onContextMenu(pointerEvent.clientX, pointerEvent.clientY, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ export default function transformProps(
const data1 = (queriesData[0].data || []) as TimeseriesDataRecord[];
const data2 = (queriesData[1].data || []) as TimeseriesDataRecord[];
const annotationData = getAnnotationData(chartProps);

const coltypeMapping = {
...getColtypesMapping(queriesData[0]),
...getColtypesMapping(queriesData[1]),
};
const {
area,
areaB,
Expand Down Expand Up @@ -523,5 +526,6 @@ export default function transformProps(
type: xAxisType,
},
refs,
coltypeMapping,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,6 @@ export default function transformProps(
onContextMenu,
refs,
emitCrossFilters,
coltypeMapping,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,6 @@ export default function transformProps(
selectedValues,
onContextMenu,
refs,
coltypeMapping,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@
* under the License.
*/
import React, { useCallback } from 'react';
import { BinaryQueryObjectFilterClause } from '@superset-ui/core';
import {
BinaryQueryObjectFilterClause,
getColumnLabel,
getNumberFormatter,
getTimeFormatter,
} from '@superset-ui/core';
import { SunburstTransformedProps } from './types';
import Echart from '../components/Echart';
import { EventHandlers, TreePathInfo } from '../types';
import { formatSeriesName } from '../utils/series';

export const extractTreePathInfo = (treePathInfo: TreePathInfo[] | undefined) =>
(treePathInfo ?? [])
Expand All @@ -39,6 +45,7 @@ export default function EchartsSunburst(props: SunburstTransformedProps) {
onContextMenu,
refs,
emitCrossFilters,
coltypeMapping,
} = props;
const { columns } = formData;

Expand Down Expand Up @@ -102,7 +109,7 @@ export default function EchartsSunburst(props: SunburstTransformedProps) {
const { treePathInfo } = props;
handleChange(treePathInfo);
},
contextmenu: eventParams => {
contextmenu: async eventParams => {
if (onContextMenu) {
eventParams.event.stop();
const { data, treePathInfo } = eventParams;
Expand All @@ -120,10 +127,17 @@ export default function EchartsSunburst(props: SunburstTransformedProps) {
formattedVal: path,
}),
);
const val = treePath[treePath.length - 1];
drillByFilters.push({
col: columns[treePath.length - 1],
op: '==',
val: treePath[treePath.length - 1],
val,
formattedVal: formatSeriesName(val, {
timeFormatter: getTimeFormatter(formData.dateFormat),
numberFormatter: getNumberFormatter(formData.numberFormat),
coltype:
coltypeMapping?.[getColumnLabel(columns[treePath.length - 1])],
}),
});
}
onContextMenu(pointerEvent.clientX, pointerEvent.clientY, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,6 @@ export default function transformProps(
selectedValues: filterState.selectedValues || [],
onContextMenu,
refs,
coltypeMapping,
};
}
Loading

0 comments on commit 4562e1e

Please sign in to comment.