justinpark commented on code in PR #30252:
URL: https://github.com/apache/superset/pull/30252#discussion_r1757285291


##########
superset-frontend/src/dashboard/util/crossFilters.ts:
##########
@@ -52,6 +52,20 @@ export const getCrossFiltersConfiguration = (
     return undefined;
   }
 
+  const chartsByDataSource: Record<string, number[]> = Object.values(
+    charts,
+  ).reduce((acc: Record<string, number[]>, chart) => {
+    if (!chart.form_data) {
+      return acc;
+    }
+    const { datasource } = chart.form_data;
+    if (!acc[datasource]) {
+      acc[datasource] = [];
+    }
+    acc[datasource].push(chart.id);

Review Comment:
   Using a set would likely make the algorithm more efficient.
   ```suggestion
       if (!acc[datasource]) {
         acc[datasource] = new Set();
       }
       acc[datasource].add(chart.id);
   ```



-- 
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