Table Chart Data Export#
Apache Superset's Table chart supports exporting data to CSV, Excel (XLSX), and JSON. The export path diverges depending on whether the chart uses client-side pagination (default) or server-side pagination, and whether the export is triggered from the dashboard UI or a scheduled report.
Row Limit Configuration#
Four config variables in superset/config.py govern how many rows are returned:
| Variable | Default | Purpose |
|---|---|---|
ROW_LIMIT | 50,000 | Default row limit for chart data queries |
SQL_MAX_ROW | 100,000 | Hard cap for non-server-paginated table queries |
TABLE_VIZ_MAX_ROW_SERVER | 500,000 | Hard cap when server-side pagination is enabled |
ALLOW_FULL_CSV_EXPORT (feature flag) | False | Enables "Export to full .CSV / Excel" menu items in dashboard |
The backend enforces these caps in apply_max_row_limit() (superset/utils/core.py). When server_pagination=True the limit is capped at TABLE_VIZ_MAX_ROW_SERVER; otherwise it is capped at SQL_MAX_ROW. A limit of 0 is treated as "use the max" .
Frontend Query Construction (buildQuery.ts)#
buildQuery.ts in superset-frontend/plugins/plugin-chart-table/src/ is the single source of truth for how query parameters are assembled before being sent to the backend.
Download path (result_format is csv, xlsx, or JSON-results): the query sets row_limit from formData.row_limit and resets row_offset to 0 .
Server-pagination preview path (not a download): the query uses ownState.pageSize (falling back to server_page_length) for row_limit and derives row_offset from the current page . A separate is_rowcount: true query is also emitted so the table knows total row count .
Known Bugs & Recent Fixes#
Frontend: row limit not respected with server pagination (merged June 2026)#
PR #41024 fixed a bug where server-paginated previews ignored row_limit. Previously the last page of a row_limit=120, server_page_length=50 chart would still request 50 rows, returning up to 150 rows total. The fix:
- Computes
lastPagefromrow_limit / pageSizeand clampscurrentPageto it. - Caps each page's
row_limitto the remaining rows within the configuredrow_limit(so the last page only requests the remainder). - Resets to full first-page
row_limiton filter-change, without corrupting the storedpageSizeinownState.
Scheduled report exports: wrong row limit used (merged July 2026)#
PR #41103 fixed scheduled CSV/XLSX report exports for server-paginated Table charts. The report worker was sending the saved query context from the preview path, which carried row_limit = server_page_length instead of row_limit = form_data.row_limit, and included a superfluous is_rowcount query.
The fix (in superset/commands/report/execute.py) adds _get_chart_data_request_payload(), which:
- Reads the saved
query_contextfrom the chart model. - When
form_data["server_pagination"]is set, overwrites the first data query'srow_limitfromform_data["row_limit"]and resetsrow_offsetto0. - Strips any
is_rowcountquery from the payload. - POSTs to the chart data API (
ChartDataRestApi.data) withresult_format=CSV/XLSXandresult_type=post-processed.
This change is scoped to the report worker and does not alter the public chart data API contract .
ALLOW_FULL_CSV_EXPORT Feature Flag#
When enabled, the dashboard header for Table charts gains two extra menu items — "Export to full .CSV" and "Export to full Excel" — gated by both the feature flag and the can_csv permission . This flag is False by default because an unrestricted export can exhaust server memory or compute .
The flag is listed as "In Testing" in the feature flags documentation.
Key Source Files#
| File | Role |
|---|---|
superset/config.py | All row limit and feature flag defaults |
superset/utils/core.py – apply_max_row_limit() | Backend row-limit enforcement |
plugin-chart-table/src/buildQuery.ts | Frontend query construction (download vs. preview logic) |
superset/commands/report/execute.py | Scheduled report export execution |
SliceHeaderControls/index.tsx | Dashboard "full export" menu items gated by ALLOW_FULL_CSV_EXPORT |