CodeWithPravinMaske opened a new pull request, #45785: URL: https://github.com/apache/superset/pull/45785
### SUMMARY When a Table chart has **Show summary** enabled, the summary row is built from a second query. A CSV or Excel download of that chart then ran two queries, and Superset bundles several queries into a `.zip` (`query_1.csv` with the rows, `query_2.csv` with the summary row). Someone who only views the dashboard gets a zip with two unlabeled files instead of the table they expected. This skips the summary query when the request is a CSV or Excel download (`result_format` of `csv` or `xlsx`) in the Table plugin's `buildQuery`, so a download is one file. The summary row is still shown in the table on the dashboard and in Explore, because those use the JSON format. Charts without Show summary are unchanged. Not changed: the AG Grid Table keeps its summary query in downloads, because its existing tests expect it. Scheduled reports and email attachments use the chart's saved query context and are not covered here. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Before: Show summary on, download is a `.zip`. <img width="2000" height="1005" alt="show-summary-option-in-explore" src="https://github.com/user-attachments/assets/b94fe815-eb58-4bfb-88ea-9f75db7fb141" /> <img width="2000" height="758" alt="before-zip-download" src="https://github.com/user-attachments/assets/1143c53c-1f57-4f41-aa1f-3c01aa3476a4" /> After: one `.csv`, and the table still shows the summary row. <img width="2000" height="1030" alt="after-single-csv" src="https://github.com/user-attachments/assets/82936540-9157-4f26-92f6-ee3fab40e45c" /> The chart uses made-up sample data. ### TESTING INSTRUCTIONS 1. Create a Table chart in Aggregate mode with a metric. In the Data tab, Query section, tick **Show summary** and save it to a dashboard. 2. On the dashboard, use the chart's "..." > Download > Export to .CSV (or Excel). 3. Before: a `.zip` with two files. After: a single `.csv` / `.xlsx` with the table rows, and the summary row still shown in the table. 4. With Show summary off, the download is unchanged. Unit test: `npx jest plugins/plugin-chart-table/test/buildQuery.test.ts` ### ADDITIONAL INFORMATION - [ ] Has associated issue: #<number, if you opened one> - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
