DamianPendrak commented on code in PR #37176:
URL: https://github.com/apache/superset/pull/37176#discussion_r2695397752


##########
superset-frontend/src/dataMask/reducer.ts:
##########
@@ -216,9 +220,17 @@ const dataMaskReducer = produce(
           loadedDataMask,
         );
 
-        const chartCustomizationConfig =
+        const rawChartCustomizationConfig =
           metadata?.chart_customization_config || [];
 
+        const hasLegacyFormat = rawChartCustomizationConfig.some(item =>
+          isLegacyChartCustomizationFormat(item),
+        );
+
+        const chartCustomizationConfig = hasLegacyFormat
+          ? migrateChartCustomizationArray(rawChartCustomizationConfig)
+          : (rawChartCustomizationConfig as ChartCustomization[]);

Review Comment:
   migrateChartCustomizationArray checks if the item is legacy and only then 
migrates it



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to