alex-poor commented on code in PR #37109:
URL: https://github.com/apache/superset/pull/37109#discussion_r2724782961
##########
superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx:
##########
@@ -117,6 +174,73 @@ export default function DrillDetailModal({
history.push(exploreUrl);
}, [exploreUrl, history]);
+ const handleDownload = useCallback(
+ (exportType: 'csv' | 'xlsx') => {
+ const drillPayload = getDrillPayload(formData, initialFilters);
+
+ if (!drillPayload) {
+ dispatch(addDangerToast(t('Unable to generate download payload')));
+ return;
+ }
+
+ if (!formData.datasource || typeof formData.datasource !== 'string') {
+ dispatch(addDangerToast(t('Invalid datasource configuration')));
+ return;
+ }
+
+ const datasourceParts = formData.datasource.split('__');
+ if (datasourceParts.length !== 2) {
+ dispatch(addDangerToast(t('Invalid datasource format')));
+ return;
+ }
+
+ const [datasourceId, datasourceType] = datasourceParts;
Review Comment:
The current implementation appears to be correct. The datasource string
format in Superset is "id__type" (ID first, type second), as confirmed by:
- DrillDetailPane.tsx:111-113 (uses same destructuring order)
- getParsedExploreURLParams.ts:35 (datasource_id first, datasource_type
second)
- chartAction.js usage throughout the codebase
The code correctly parses datasourceId as the numeric ID and datasourceType
as the string type.
--
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]