You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2025/09/05 18:17:28 UTC
(superset) branch 6.0 updated (444b98b95e -> 997e000f6b)
This is an automated email from the ASF dual-hosted git repository.
jli pushed a change to branch 6.0
in repository https://gitbox.apache.org/repos/asf/superset.git
from 444b98b95e fix(sql): Add Impala dialect support to sqlglot parser (#34662)
new 7996359719 fix: display legend mixed timeseries chart (#35005)
new 428c97a1d6 fix(echarts): rename time series shifted for isTimeComparisonValue (#35022)
new 997e000f6b fix(chart): change "No query." to "Query cannot be loaded" in Multi Layer Deck.gl Chart (#34973)
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../src/operators/renameOperator.ts | 14 ++++----
.../test/operators/renameOperator.test.ts | 38 ++++++++++++++++++++++
.../src/MixedTimeseries/transformProps.ts | 2 ++
.../test/MixedTimeseries/transformProps.test.ts | 36 ++++++++++++++++++++
superset/views/core.py | 2 +-
5 files changed, 85 insertions(+), 7 deletions(-)
(superset) 03/03: fix(chart): change "No query." to "Query cannot be loaded" in Multi Layer Deck.gl Chart (#34973)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jli pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 997e000f6bf110c7750fa39330c279e88e006720
Author: Damian Pendrak <dp...@gmail.com>
AuthorDate: Fri Sep 5 19:22:45 2025 +0200
fix(chart): change "No query." to "Query cannot be loaded" in Multi Layer Deck.gl Chart (#34973)
(cherry picked from commit c65cb284e60f5658a120b24d2a2b0f1042d5fed9)
---
superset/views/core.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/superset/views/core.py b/superset/views/core.py
index 384e88d159..0639c728ef 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -157,7 +157,7 @@ class Superset(BaseSupersetView):
return json_error_response(err_msg)
if not query:
- query = "No query."
+ query = __("Query cannot be loaded.")
return self.json_response(
{"query": query, "language": viz_obj.datasource.query_language}
(superset) 02/03: fix(echarts): rename time series shifted for isTimeComparisonValue (#35022)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jli pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 428c97a1d642afce0f2cb5e767570548d28ae828
Author: JUST.in DO IT <ju...@airbnb.com>
AuthorDate: Fri Sep 5 08:39:46 2025 -0700
fix(echarts): rename time series shifted for isTimeComparisonValue (#35022)
(cherry picked from commit bc54b7970a5e84b84d7e318c23d0f97a8a8a87d0)
---
.../src/operators/renameOperator.ts | 14 ++++----
.../test/operators/renameOperator.test.ts | 38 ++++++++++++++++++++++
2 files changed, 46 insertions(+), 6 deletions(-)
diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/operators/renameOperator.ts b/superset-frontend/packages/superset-ui-chart-controls/src/operators/renameOperator.ts
index 9e1076900f..86643e2682 100644
--- a/superset-frontend/packages/superset-ui-chart-controls/src/operators/renameOperator.ts
+++ b/superset-frontend/packages/superset-ui-chart-controls/src/operators/renameOperator.ts
@@ -43,15 +43,17 @@ export const renameOperator: PostProcessingFactory<PostProcessingRename> = (
// remove or rename top level of column name(metric name) in the MultiIndex when
// 1) at least 1 metric
- // 2) dimension exist or multiple time shift metrics exist
- // 3) xAxis exist
- // 4) truncate_metric in form_data and truncate_metric is true
+ // 2) xAxis exist
+ // 3a) isTimeComparisonValue
+ // 3b-1) dimension exist or multiple time shift metrics exist
+ // 3b-2) truncate_metric in form_data and truncate_metric is true
if (
metrics.length > 0 &&
- (columns.length > 0 || timeOffsets.length > 1) &&
xAxisLabel &&
- truncate_metric !== undefined &&
- !!truncate_metric
+ (isTimeComparisonValue ||
+ ((columns.length > 0 || timeOffsets.length > 1) &&
+ truncate_metric !== undefined &&
+ !!truncate_metric))
) {
const renamePairs: [string, string | null][] = [];
if (
diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/operators/renameOperator.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/operators/renameOperator.test.ts
index 19d594a7f6..26669a7510 100644
--- a/superset-frontend/packages/superset-ui-chart-controls/test/operators/renameOperator.test.ts
+++ b/superset-frontend/packages/superset-ui-chart-controls/test/operators/renameOperator.test.ts
@@ -160,6 +160,44 @@ test('should add renameOperator if exists derived metrics', () => {
});
});
+test('should add renameOperator if isTimeComparisonValue without columns', () => {
+ [
+ ComparisonType.Difference,
+ ComparisonType.Ratio,
+ ComparisonType.Percentage,
+ ].forEach(type => {
+ expect(
+ renameOperator(
+ {
+ ...formData,
+ ...{
+ comparison_type: type,
+ time_compare: ['1 year ago'],
+ },
+ },
+ {
+ ...queryObject,
+ ...{
+ columns: [],
+ metrics: ['sum(val)', 'avg(val2)'],
+ },
+ },
+ ),
+ ).toEqual({
+ operation: 'rename',
+ options: {
+ columns: {
+ [`${type}__avg(val2)__avg(val2)__1 year ago`]:
+ 'avg(val2), 1 year ago',
+ [`${type}__sum(val)__sum(val)__1 year ago`]: 'sum(val), 1 year ago',
+ },
+ inplace: true,
+ level: 0,
+ },
+ });
+ });
+});
+
test('should add renameOperator if x_axis does not exist', () => {
expect(
renameOperator(
(superset) 01/03: fix: display legend mixed timeseries chart (#35005)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jli pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 7996359719faa2cb23074111a144f3d799dea989
Author: SBIN2010 <13...@users.noreply.github.com>
AuthorDate: Fri Sep 5 02:39:57 2025 +0300
fix: display legend mixed timeseries chart (#35005)
(cherry picked from commit 031fb4b5a8b391ce1ae85a8685e9e4a16682f689)
---
.../src/MixedTimeseries/transformProps.ts | 2 ++
.../test/MixedTimeseries/transformProps.test.ts | 36 ++++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
index 1ecf56f039..def74128c2 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
@@ -423,6 +423,7 @@ export default function transformProps(
{
...entry,
id: `${displayName || ''}`,
+ name: `${displayName || ''}`,
},
colorScale,
colorScaleKey,
@@ -489,6 +490,7 @@ export default function transformProps(
{
...entry,
id: `${displayName || ''}`,
+ name: `${displayName || ''}`,
},
colorScale,
diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
index 436062b7ef..24693494e4 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
@@ -137,6 +137,24 @@ it('should transform chart props for viz with showQueryIdentifiers=false', () =>
expect(seriesIds).not.toContain('sum__num (Query A), boy');
expect(seriesIds).not.toContain('sum__num (Query B), girl');
expect(seriesIds).not.toContain('sum__num (Query B), boy');
+
+ // Check that series name include query identifiers
+ const seriesName = (transformed.echartOptions.series as any[]).map(
+ (s: any) => s.name,
+ );
+ expect(seriesName).toContain('sum__num, girl');
+ expect(seriesName).toContain('sum__num, boy');
+ expect(seriesName).not.toContain('sum__num (Query A), girl');
+ expect(seriesName).not.toContain('sum__num (Query A), boy');
+ expect(seriesName).not.toContain('sum__num (Query B), girl');
+ expect(seriesName).not.toContain('sum__num (Query B), boy');
+
+ expect((transformed.echartOptions.legend as any).data).toEqual([
+ 'sum__num, girl',
+ 'sum__num, boy',
+ 'sum__num, girl',
+ 'sum__num, boy',
+ ]);
});
it('should transform chart props for viz with showQueryIdentifiers=true', () => {
@@ -160,4 +178,22 @@ it('should transform chart props for viz with showQueryIdentifiers=true', () =>
expect(seriesIds).toContain('sum__num (Query B), boy');
expect(seriesIds).not.toContain('sum__num, girl');
expect(seriesIds).not.toContain('sum__num, boy');
+
+ // Check that series name include query identifiers
+ const seriesName = (transformed.echartOptions.series as any[]).map(
+ (s: any) => s.name,
+ );
+ expect(seriesName).toContain('sum__num (Query A), girl');
+ expect(seriesName).toContain('sum__num (Query A), boy');
+ expect(seriesName).toContain('sum__num (Query B), girl');
+ expect(seriesName).toContain('sum__num (Query B), boy');
+ expect(seriesName).not.toContain('sum__num, girl');
+ expect(seriesName).not.toContain('sum__num, boy');
+
+ expect((transformed.echartOptions.legend as any).data).toEqual([
+ 'sum__num (Query A), girl',
+ 'sum__num (Query A), boy',
+ 'sum__num (Query B), girl',
+ 'sum__num (Query B), boy',
+ ]);
});