This is an automated email from the ASF dual-hosted git repository.

arivero pushed a commit to branch table-time-comparison-offset
in repository https://gitbox.apache.org/repos/asf/superset.git

commit fde66816646311ba378c6154c7efa04b94830d8d
Author: Antonio Rivero <[email protected]>
AuthorDate: Wed Apr 24 15:15:26 2024 +0200

    Table with Time Comparison:
    
    - When any other calculation type is used instead of Actual Values, render 
the table as without comparison columns because the API returns single columns
---
 superset-frontend/plugins/plugin-chart-table/src/transformProps.ts  | 6 +++++-
 .../src/explore/components/controls/ComparisonRangeLabel.tsx        | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts 
b/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
index 0a9da3a590..6f28051513 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
@@ -18,6 +18,7 @@
  */
 import memoizeOne from 'memoize-one';
 import {
+  ComparisonType,
   CurrencyFormatter,
   DataRecord,
   ensureIsArray,
@@ -399,9 +400,12 @@ const transformProps = (
     time_compare,
     comparison_color_enabled: comparisonColorEnabled = false,
     comparison_color_scheme: comparisonColorScheme = ColorSchemeEnum.Green,
+    comparison_type,
   } = formData;
   const isUsingTimeComparison =
-    !isEmpty(time_compare) && queryMode === QueryMode.Aggregate;
+    !isEmpty(time_compare) &&
+    queryMode === QueryMode.Aggregate &&
+    comparison_type === ComparisonType.Values;
 
   const calculateBasicStyle = (
     percentDifferenceNum: number,
diff --git 
a/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx 
b/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx
index d14ba60b90..ff5008f2d2 100644
--- a/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx
+++ b/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx
@@ -24,7 +24,6 @@ import moment from 'moment';
 import {
   BinaryAdhocFilter,
   css,
-  ensureIsArray,
   fetchTimeRange,
   SimpleAdhocFilter,
   t,

Reply via email to