feat(table): Export table data with "Search box" enabled#36281
Conversation
Code Review Agent Run #041f8bActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
Love it! I think the change I'd want to see (at least, as of when we chatted) would be to only show this new menu option when it's relevant. We might want to just enable it for charts where it's relevant, via an entry in the chart's metadata. In this case, that would be |
8d872fb to
fb96bf7
Compare
|
@rusackas Hey Evan! Thank you for communicating with one of my teammate Rebecca. Could you please run the test again? |
|
Looks like pre-commit needs to be run, and that might unblock some of the other failing CI jobs. |
There was a problem hiding this comment.
Pull request overview
This PR implements a feature to export filtered table data when the search box is enabled and client-side pagination is used. Previously, exports would include all data regardless of search filters. The implementation adds a new "Export Current View" option alongside the existing "Export All Data" option, with the current view export respecting client-side search filters.
Key Changes:
- Added client-side export functions (CSV, JSON, XLSX) that work with filtered data stored in component state
- Introduced a new two-level menu structure: "Export All Data" and "Export Current View" (when supported by the chart type)
- Implemented a callback mechanism to pass filtered rows from DataTable to TableChart, which are then stored in ownState for export access
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx | Added client-side export functions (CSV, JSON, XLSX) and restructured the export menu to include "Export All Data" and "Export Current View" options |
| superset-frontend/src/explore/components/ExploreViewContainer/index.jsx | Modified ownState comparison to exclude clientView from triggering re-queries, preventing unnecessary backend calls |
| superset-frontend/plugins/plugin-chart-table/src/index.ts | Registered 'EXPORT_CURRENT_VIEW' as a custom behavior for the Table chart plugin |
| superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx | Added state management for clientView data and pushed filtered rows/columns to ownState via setDataMask |
| superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx | Implemented onFilteredRowsChange callback to emit filtered rows to parent component using RAF for performance |
| superset-frontend/plugins/plugin-chart-table/src/DataTable/utils/externalAPIs.ts | Fixed arrow function syntax for consistency (added curly braces) |
| superset-frontend/plugins/plugin-chart-table/src/DataTable/types/react-table.d.ts | Added clientView property to TableOwnState interface |
Comments suppressed due to low confidence (1)
superset-frontend/src/explore/components/ExploreViewContainer/index.jsx:611
- The
useEffectat line 604 is missingonQueryandreRenderChartfrom its dependency array. While these are wrapped inuseCallbackand likely stable, they should still be included in the dependency array for completeness and to satisfy ESLint's exhaustive-deps rule. Add them to the dependency array at line 611:
}, [props.ownState, onQuery, reRenderChart, previousOwnState]); useEffect(() => {
const strip = s =>
s && typeof s === 'object' ? omit(s, ['clientView']) : s;
if (!isEqual(strip(previousOwnState), strip(props.ownState))) {
onQuery();
reRenderChart();
}
}, [props.ownState]);
| 'EXPORT_CURRENT_VIEW' as any, | ||
| ], |
There was a problem hiding this comment.
[nitpick] Using as any to add a custom behavior bypasses TypeScript's type safety. Consider either:
- Adding
EXPORT_CURRENT_VIEWto theBehaviorenum in@superset-ui/coreif this is intended to be a standard behavior, or - Extending the behaviors array type to support string literals for custom behaviors.
This would make the implementation more type-safe and maintainable.
| 'EXPORT_CURRENT_VIEW' as any, | |
| ], | |
| 'EXPORT_CURRENT_VIEW', | |
| ] as (Behavior | 'EXPORT_CURRENT_VIEW')[], |
fe1ffbe to
728a03f
Compare
|
Hey @rusackas! I noticed that mypy (main) reported a few Unused "type: ignore" warnings during git commit.
but when I ran:
everything passed successfully with no errors. I believe this should be fine since pre-commit run --all-files is consistent with the checks performed in CI. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #36281 +/- ##
===========================================
+ Coverage 0 67.97% +67.97%
===========================================
Files 0 634 +634
Lines 0 46727 +46727
Branches 0 5070 +5070
===========================================
+ Hits 0 31763 +31763
- Misses 0 13697 +13697
- Partials 0 1267 +1267
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
CodeAnt AI is reviewing your PR. |
Nitpicks 🔍
|
41f3211 to
19de663
Compare
@rusackas All good locally now in my side! When you have a moment, please rerun CI. Thanks! |
|
CodeAnt AI is running Incremental review |
rusackas
left a comment
There was a problem hiding this comment.
LGTM! Thank you for following through on all this!
Co-authored-by: RebeccaH2003 <114100529+RebeccaH2003@users.noreply.github.com>
Cover remaining 6.1 features across existing and new pages: MCP server: - Add MCP_PARSE_REQUEST_ENABLED to configuration reference - Add Audit Events section (MCP tool calls appear in Action Log) - Add Tool Pagination section documenting cursor-based pagination (#37674) Using AI with Superset: - Expand Available Tools Reference into categorized sections covering all new tools added in the MCP tool library expansion - Document preview-first workflow for generate_chart / update_chart Creating Your First Dashboard: - AG Grid server-side column filters (#35683): filter types, AND/OR logic, pagination interaction - Time Shift for AG Grid Interactive Table (#37072) - Dynamic currency formatting via currency_code_column dataset field (#36416) - ECharts option editor in Explore for JSON overrides (#37868) - Table chart: export behavior with search filter active (#36281) - Dataset folders: organizing datasets into groups (#36239) - PWA file handler: opening CSV/XLS/Parquet from OS file manager (#36191) - Share database connection option when adding a new database (#37940) Exploring Data: - Dialect-aware Format SQL (applies selected database dialect) (#39393) - SQL Lab tips section and time range natural language expressions (consolidates content from batch 4 for master branch) Importing/Exporting: - Dashboard import overwrite behavior: charts are replaced not duplicated (#36551) - UUID in REST API POST responses for dataset/chart/dashboard (#37806) New pages: - docs/docs/using-superset/embedding.mdx: embedded SDK quick start, resolvePermalinkUrl callback (#36924), DISABLE_EMBEDDED_SUPERSET_LOGOUT feature flag (#37537), URL parameters, guest token security notes - docs/admin_docs/configuration/aws-iam.mdx: cross-account IAM authentication for Aurora and Redshift via STS AssumeRole (#37585), configuration reference, trust policy setup guide Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: RebeccaH2003 <114100529+RebeccaH2003@users.noreply.github.com>

User description
SUMMARY
According to the issue#35141, the export functionality for table chart when the search box enabled and pagination is disabled has some unexpected behaviours for it. We fixed Table chart export by passing filtered rows from DataTable to TableChart using a new callback and storing them in ownState.clientView, allowing frontend exports without backend queries.
Unexpected Behaviour: When the search box is enabled, it will export all data if we do export .CSV, Excel, .JSON
Expected Behaviour: We should export the data appeared in the current view (i.e. filtered data)
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
The before screenshot can be checked in issue#35141. More details in the issue page.



The after screenshot:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
CodeAnt-AI Description
Export only the currently visible table rows from Explore and clarify data export options
What Changed
Impact
✅ Exports respect table search and client-side filters✅ Clearer choice between exporting all data vs current view✅ Fewer unnecessary chart reloads during table interactions💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.