download as pivoted excel in custom pivot plugin #38577
Replies: 1 comment 3 replies
|
The "download as pivoted excel/CSV" functionality in Superset is hardcoded for specific viz types—it's not automatically inherited by custom plugins. Your To enable pivoted downloads for your custom plugin, you'll need to modify Superset's core code in three places: 1. Frontend - Export Menu (useExploreAdditionalActionsMenu/index.jsx) Add your viz_type to the const VIZ_TYPES_PIVOTABLE = [
VizType.PivotTable,
'smsrc-custom-pivot', // Add your custom viz_type
];2. Frontend - Dashboard Export (SliceHeaderControls/index.tsx) Update the pivot table check to include your viz_type: const isPivotTable = slice.viz_type === VizType.PivotTable ||
slice.viz_type === 'smsrc-custom-pivot';3. Backend - Post Processor (client_processing.py) Register your viz_type in the post_processors = {
"pivot_table_v2": pivot_table_v2,
"table": table,
"smsrc-custom-pivot": pivot_table_v2, # Reuse existing logic if your data structure matches
}If your custom pivot uses the same data structure as the default pivot table, you can reuse the Unfortunately, there's no plugin metadata or To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Uh oh!
There was an error while loading. Please reload this page.
I have made a new pivot plugin , with some visualization changes , and registered in mainpreset , new SmsrcEchartsPieChartPlugin().configure({ key: 'smsrc-custom-pivot' }),
but superset 6 give custom download option as pivoted excel or csv which i am not getting in my plugin
how to fix that.
i need to keep both the custom pivot and the normal pivot in my project
@dosubot
All reactions