EnxDev commented on code in PR #45785:
URL: https://github.com/apache/superset/pull/45785#discussion_r4431282219


##########
superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts:
##########
@@ -385,7 +385,12 @@ export const buildQuery: BuildQuery<TableChartFormData> = (
 
     const calculationMode = formData.percent_metric_calculation || 'row_limit';
 
+    // The summary row and the percent denominators are display features: a 
file download keeps
+    // one query so it is one file (several queries are bundled into a zip).
+    const isFileExport = ['csv', 'xlsx'].includes(formData.result_format ?? 
'');

Review Comment:
   AG Grid Table still sends the summary query on downloads (the export-filter 
tests from #44308 shape that totals query on purpose), so the same Show summary 
setting now gives one file without the summary here and a zip with it there.
   
   Is dropping it what we want for both? If so, the same guard in 
`plugin-chart-ag-grid-table/src/buildQuery.ts` keeps them in step, which 
matters for anyone moving charts over with the Table to AG Grid migration.



##########
superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts:
##########
@@ -405,6 +410,7 @@ export const buildQuery: BuildQuery<TableChartFormData> = (
     if (
       metrics?.length &&
       formData.show_totals &&
+      !isFileExport &&

Review Comment:
   The server-side copy of this builder, `_table_queries` in 
`superset/common/form_data_query_context.py` (around line 1570), still appends 
the all-records and totals queries for csv/xlsx, and its module docstring asks 
to keep it in sync with this file. MCP `get_chart_data` goes through it for csv 
and excel, so those exports keep running two whole-table aggregates it never 
reads.
   
   Could you mirror the guard there, or flag it for a follow-up if you'd rather 
keep this PR frontend-only?



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