Bug description
Having a table chart with many rows and option Search box
enabled and trying to export the data, the behavior is:
- Download as image. It works as expected, because only shown data (filtered by search box) is exported.
- Export to full .CSV/Excel. I think that it works as expected, because all data is exported, regardless the filter included in the Search box.
- Export to .CSV/Excel. I think that it does not work as expected. Giving that search box filter, the final user expects to download only the table rows seen in the screen, but the downloaded file includes all rows, regardless the filter included in the Search box.
I think that this is a bug regarding Export to .CSV
and Export to Excel
functions. It should apply the same filter included in search box before exporting the data.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
The export to CSV/Excel in Superset table charts does not currently respect the Search box filter unless server-side pagination is enabled. By default, the Search box performs client-side filtering—this only affects what you see in the browser, not what gets exported. When you export, Superset builds a query that ignores the search filter state unless you have server pagination enabled, in which case the filter is sent to the backend and applied to the export data. This is a limitation of the current implementation and not a recent change or bug fix in the codebase [buildQuery.ts].
If you want exports to reflect the Search box filter, you need to enable server-side pagination for your table chart. Otherwise, exports will always include all rows, regardless of what is filtered in the UI. There are no recent pull requests addressing this behavior.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: alesnav
@dosu if the final user gets a filtered image when exporting the data, he/she expects the same when exporting to Excel/.CSV
In addition, if the search box filter is not applied in the exporting process, what's the difference between "Export to Excel" and "Export to full Excel"?
Comment From: dosubot[bot]
Exporting as an image captures exactly what you see in the browser, including any client-side filters like the search box. In contrast, exporting to Excel/CSV sends a request to the backend, which by default does not know about client-side filters—so the export includes all rows unless server-side pagination is enabled and the filter is sent to the backend.
The difference between "Export to Excel" and "Export to full Excel" is about scope: "Export" typically exports just the currently paginated (visible) data, while "Export to full" exports the entire dataset. However, neither option applies the search box filter unless server-side pagination is enabled and the filter is passed to the backend. This is a limitation of how Superset currently handles exports and is not explicitly documented in the UI or code comments—it's inferred from how export requests are processed on the backend and how pagination is handled in the frontend [discussion].
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other