Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/apache/superset into fix/…
Browse files Browse the repository at this point in the history
…eslint-theme-colors-top-level
  • Loading branch information
geido committed Apr 8, 2022
2 parents 1771e21 + 761d5c4 commit 9e5781c
Show file tree
Hide file tree
Showing 71 changed files with 1,110 additions and 767 deletions.
1 change: 1 addition & 0 deletions RELEASING/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ partaking in the process should join the channel.

## Release notes for recent releases

- [1.5](release-notes-1-5/README.md)
- [1.4](release-notes-1-4/README.md)
- [1.3](release-notes-1-3/README.md)
- [1.2](release-notes-1-2/README.md)
Expand Down
142 changes: 142 additions & 0 deletions RELEASING/release-notes-1-5/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<!--
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.
-->

# Release Notes for Superset 1.5

Superset 1.5 focuses on polishing the dashboard native filters experience, while
improving performance and stability. Superset 1.5 is likely the last minor release of
version 1 of Superset, and will be succeeded by Superset 2.0. The 1.5 branch
introduces the notion of a Long Term Support (LTS) version of Superset, and will
receive security and other critical fixes even after Superset 2.x is released.
Therefore, users will have the choice of staying on the 1.5 branch or upgrading to 2.x
when available.

- [**User Experience**](#user-facing-features)
- [**Feature flags**](#feature-flags)
- [**Database Experience**](#database-experience)
- [**Breaking Changes and Full Changelog**](#breaking-changes-and-full-changelog)

## User Facing Features

- Complex dashboards with lots of native filters and charts will render considerably
faster. See the videos that shows the rendering time of a complex dashboard go from
11 to 3 seconds: [#19064](https://github.com/apache/superset/pull/19064). In
addition, applying filters and switching tabs is also much smoother.
- The Native Filter Bar has been redesigned, along with moving the "Apply" and
"Clear all" buttons to the bottom:

![Filter bar](media/filter_bar.png)

- Native filters can now be made dependent on multiple filters. This makes it possible
to restrict the available values in a filter based on the selection of other filters.

![Dependent filters](media/dependent_filters.png)

- In addition to being able to write Custom SQL for adhoc metrics and filters, the
column control now also features a Custom SQL tab. This makes it possible to write
custom expressions directly in charts without adding them to the dataset as saved
expressions.

![Adhoc columns](media/adhoc_columns.png)

- A new `SupersetMetastoreCache` has been added which makes it possible to cache data
in the Superset Metastore without the need for running a dedicated cache like Redis
or Memcached. The new cache will be used by default for required caches, but can also
be used for caching chart or other data. See the
[documentation](https://superset.apache.org/docs/installation/cache#caching) for
details on using the new cache.
- Previously it was possible for Dashboards with lots of filters to cause an error.
A similar issue existed on Explore. Now Superset stores Dashboard and Explore state
in the cache (as opposed to the URL), eliminating the infamous
[Long URL Problem](https://github.com/apache/superset/issues/17086).
- Previously permanent links to Dashboard and Explore pages were in fact shortened URLS
that relied on state being stored in the URL (see Long URL Problem above). In
addition, the links used numerical ids and didn't check user permissions making it
easy to iterate through links that were stored in the metastore. Now permanent links
state is stored as JSON objects in the metastore, making it possible to store
arbitrarily large Dashboard and Explore state in permalinks. In addition, the ids
are encoded using [`hashids`](https://hashids.org/) and check permissions, making
permalink state more secure.

![Dashboard permalink](media/permalink.png)

## Feature flags

- A new feature flag `GENERIC_CHART_AXES` has been added that makes it possible to
use a non-temporal x-axis on the ECharts Timeseries chart
([#17917](https://github.com/apache/superset/pull/17917)). When enabled, a new
control "X Axis" is added to the control panel of ECharts line, area, bar, step and
scatter charts, which makes it possible to use categorical or numerical x-axes on
those charts.

![Categorical line chart](media/categorical_line.png)

## Database Experience

- DuckDB: Add support for database:
[#19317](https://github.com/apache/superset/pull/19317)

- Kusto: Add support for Azure Data Explorer (Kusto):
[#17898](https://github.com/apache/superset/pull/17898)

- Trino: Add server cert support and new auth methods:
[#17593](https://github.com/apache/superset/pull/17593) and
[#16346](https://github.com/apache/superset/pull/16346)

- Microsoft SQL Server (MSSQL): support using CTEs in virtual tables:
[#18567](https://github.com/apache/superset/pull/18567)

- Teradata and MSSQL: add support for TOP limit syntax:
[#18746](https://github.com/apache/superset/pull/18746) and
[#18240](https://github.com/apache/superset/pull/18240)

- Apache Drill: User impersonation using `drill+sadrill`:
[#19252](https://github.com/apache/superset/pull/19252)

## Developer Experience

- `superset-ui` has now been integrated into the Superset codebase as per
[SIP-58](https://github.com/apache/superset/issues/13013) dubbed "Monorepo". This
makes development of plugins that ship with Superset considerably simpler. In
addition, it makes it possible to align `superset-ui` releases with official Superset
releases.

## Breaking Changes and Full Changelog

**Breaking Changes**

- Bump `mysqlclient` from v1 to v2:
[#17556](https://github.com/apache/superset/pull/17556)
- Single and double quotes will no longer be removed from filter values:
[#17881](https://github.com/apache/superset/pull/17881)
- Previously `QUERY_COST_FORMATTERS_BY_ENGINE`, `SQL_VALIDATORS_BY_ENGINE` and
`SCHEDULED_QUERIES` were expected to be defined in the feature flag dictionary in
the `config.py` file. These should now be defined as a top-level config, with the
feature flag dictionary being reserved for boolean only values:
[#15254](https://github.com/apache/superset/pull/15254)
- All Superset CLI commands (init, load_examples and etc) require setting the
`FLASK_APP` environment variable (which is set by default when `.flaskenv` is loaded):
[#17539](https://github.com/apache/superset/pull/17539)

**Changelog**

To see the complete changelog in this release, head to
[CHANGELOG.MD](https://github.com/apache/superset/blob/1.5/CHANGELOG.md).
As mentioned earlier, this release has a MASSIVE amount of bug fixes. The full
changelog lists all of them!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added RELEASING/release-notes-1-5/media/filter_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added RELEASING/release-notes-1-5/media/permalink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ assists people when migrating to a new version.

- [19046](https://github.com/apache/superset/pull/19046): Enables the drag and drop interface in Explore control panel by default. Flips `ENABLE_EXPLORE_DRAG_AND_DROP` and `ENABLE_DND_WITH_CLICK_UX` feature flags to `True`.
- [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.
- [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.

### Breaking Changes

Expand Down
6 changes: 4 additions & 2 deletions docs/docs/installation/sql-templating.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,12 @@ Here's a concrete example:
SELECT action, count(*) as times
FROM logs
WHERE
action in ({{ "'" + "','".join(filter_values('action_type')) + "'" }})
action in {{ filter_values('action_type')|where_in }}
GROUP BY action
```

There `where_in` filter converts the list of values from `filter_values('action_type')` into a string suitable for an `IN` expression.

**Filters for a Specific Column**

The `{{ get_filters() }}` macro returns the filters applied to a given column. In addition to
Expand Down Expand Up @@ -243,7 +245,7 @@ Here's a concrete example:
{%- if filter.get('op') == 'IN' -%}
AND
full_name IN ( {{ "'" + "', '".join(filter.get('val')) + "'" }} )
full_name IN {{ filter.get('val')|where_in }}
{%- endif -%}
{%- if filter.get('op') == 'LIKE' -%}
Expand Down
1 change: 1 addition & 0 deletions requirements/testing.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pytest
pytest-cov
statsd
pytest-mock
sqloxide
# DB dependencies
-e file:.[bigquery]
-e file:.[trino]
13 changes: 5 additions & 8 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:7a8e256097b4758bdeda2529d3d4d31e421e1a3c
# SHA1:e273e8da6bfd5f6f8563fe067e243297cc7c588c
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand Down Expand Up @@ -52,7 +52,6 @@ google-auth-oauthlib==0.4.6
google-cloud-bigquery[bqstorage,pandas]==2.29.0
# via
# -r requirements/testing.in
# apache-superset
# pandas-gbq
# pybigquery
google-cloud-bigquery-storage==2.9.1
Expand Down Expand Up @@ -105,9 +104,7 @@ openapi-schema-validator==0.1.5
openapi-spec-validator==0.3.1
# via -r requirements/testing.in
pandas-gbq==0.15.0
# via
# -r requirements/testing.in
# apache-superset
# via -r requirements/testing.in
parameterized==0.8.1
# via -r requirements/testing.in
parso==0.8.2
Expand Down Expand Up @@ -136,9 +133,7 @@ pyasn1==0.4.8
pyasn1-modules==0.2.8
# via google-auth
pybigquery==0.10.2
# via
# -r requirements/testing.in
# apache-superset
# via -r requirements/testing.in
pydata-google-auth==1.2.0
# via pandas-gbq
pyfakefs==4.5.0
Expand Down Expand Up @@ -166,6 +161,8 @@ rsa==4.7.2
# via google-auth
sqlalchemy-trino==0.4.1
# via apache-superset
sqloxide==0.1.15
# via -r requirements/testing.in
statsd==3.3.0
# via -r requirements/testing.in
traitlets==5.0.5
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def get_git_sha() -> str:
"slackclient==2.5.0", # PINNED! slack changes file upload api in the future versions
"sqlalchemy>=1.3.16, <1.4, !=1.3.21",
"sqlalchemy-utils>=0.37.8, <0.38",
"sqloxide==0.1.15",
"sqlparse==0.3.0", # PINNED! see https://github.com/andialbrecht/sqlparse/issues/562
"tabulate==0.8.9",
# needed to support Literal (3.8) and TypeGuard (3.10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
export default function parsePostForm(requestBody: ArrayBuffer) {
type ParsedFields = Record<string, string[] | string>;
if (requestBody.constructor.name !== 'ArrayBuffer') {
return requestBody as unknown as ParsedFields;
return requestBody;
}
const lines = new TextDecoder('utf-8').decode(requestBody).split('\n');
const fields: ParsedFields = {};
Expand Down
13 changes: 13 additions & 0 deletions superset-frontend/packages/superset-ui-core/src/color/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,16 @@ export function getAnalogousColors(colors: string[], results: number) {

return generatedColors;
}

export function addAlpha(color: string, opacity: number): string {
// opacity value should be between 0 and 1.
if (opacity > 1 || opacity < 0) {
throw new Error(`The opacity should between 0 and 1, but got: ${opacity}`);
}
// the alpha value is between 00 - FF
const alpha = `0${Math.round(opacity * 255)
.toString(16)
.toUpperCase()}`.slice(-2);

return `${color}${alpha}`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { getContrastingColor } from '@superset-ui/core';
import { getContrastingColor, addAlpha } from '@superset-ui/core';

describe('color utils', () => {
describe('getContrastingColor', () => {
Expand Down Expand Up @@ -60,4 +60,26 @@ describe('color utils', () => {
}).toThrow();
});
});
describe('addAlpha', () => {
it('adds 20% opacity to black', () => {
expect(addAlpha('#000000', 0.2)).toBe('#00000033');
});
it('adds 50% opacity to white', () => {
expect(addAlpha('#FFFFFF', 0.5)).toBe('#FFFFFF80');
});
it('should apply transparent alpha', () => {
expect(addAlpha('#000000', 0)).toBe('#00000000');
});
it('should apply fully opaque', () => {
expect(addAlpha('#000000', 1)).toBe('#000000FF');
});
it('opacity should be between 0 and 1', () => {
expect(() => {
addAlpha('#000000', 2);
}).toThrow();
expect(() => {
addAlpha('#000000', -1);
}).toThrow();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('ExtensibleFunction', () => {
// @ts-ignore
super(function customName() {
// @ts-ignore
return customName.x as unknown;
return customName.x;
}); // named function
this.x = x;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ describe('buildQueryObject', () => {
datasource: '5__table',
granularity_sqla: 'ds',
viz_type: 'table',
url_params: null as unknown as undefined,
// @ts-expect-error
url_params: null,
}).url_params,
).toBeUndefined();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
// eslint-disable-next-line import/extensions
import birthNamesJson from './birthNames.json';

export const birthNames = birthNamesJson as unknown as TableChartProps;
export const birthNames = birthNamesJson as TableChartProps;

export const basicFormData: TableChartFormData = {
datasource: '1__table',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,20 @@ Chord.propTypes = {
};

export default styled(Chord)`
.superset-legacy-chart-chord svg #circle circle {
fill: none;
pointer-events: all;
}
.superset-legacy-chart-chord svg .group path {
fill-opacity: 0.6;
}
.superset-legacy-chart-chord svg path.chord {
stroke: #000;
stroke-width: 0.25px;
}
.superset-legacy-chart-chord svg #circle:hover path.fade {
opacity: 0.2;
}
${({ theme }) => `
.superset-legacy-chart-chord svg #circle circle {
fill: none;
pointer-events: all;
}
.superset-legacy-chart-chord svg .group path {
fill-opacity: ${theme.opacity.mediumHeavy};
}
.superset-legacy-chart-chord svg path.chord {
stroke: ${theme.colors.grayscale.dark2};
stroke-width: 0.25px;
}
.superset-legacy-chart-chord svg #circle:hover path.fade {
opacity: ${theme.opacity.light};
}
`}
`;
Loading

0 comments on commit 9e5781c

Please sign in to comment.