michael-s-molina commented on code in PR #31979:
URL: https://github.com/apache/superset/pull/31979#discussion_r1932530410


##########
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/utils.ts:
##########
@@ -35,10 +35,13 @@ const getFontSizeMapping = (
   proportionValues: number[],
   actualSizes: number[],
 ) =>
-  proportionValues.reduce((acc, value, index) => {
-    acc[value] = actualSizes[index] ?? actualSizes[actualSizes.length - 1];
-    return acc;
-  }, {});
+  proportionValues.reduce(
+    (acc, value, index) => {
+      acc[value] = actualSizes[index] ?? actualSizes[actualSizes.length - 1];
+      return acc;
+    },
+    {} as Record<number, number>,
+  );

Review Comment:
   ```suggestion
     proportionValues.reduce<Record<number, number>>((acc, value, index) => {
       acc[value] = actualSizes[index] ?? actualSizes[actualSizes.length - 1];
       return acc;
     }, {});
   ```



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx:
##########
@@ -415,7 +415,12 @@ const config: ControlPanelConfig = {
                 const chartStatus = chart?.chartStatus;
                 const metricColumn = values.map(value => {
                   if (typeof value === 'string') {
-                    return { value, label: verboseMap[value] ?? value };
+                    return {
+                      value,
+                      label: Array.isArray(verboseMap)

Review Comment:
   The type of `verboseMap` is `Record<string, string>`. Why do we need the 
`Array.isArray(verboseMap)` check? If this is a mistake, please change all 
places where this check was introduced.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to