codeant-ai-for-open-source[bot] commented on code in PR #44499:
URL: https://github.com/apache/superset/pull/44499#discussion_r4068082806


##########
superset-frontend/src/explore/exploreUtils/index.ts:
##########
@@ -340,7 +344,11 @@ export const exportChart = async ({
   ownState = {},
   onStartStreamingExport = null,
 }: ExportChartParams): Promise<void> => {
-  const url = '/api/v1/chart/data';
+  const downloadReason = await requestDownloadReason();
+  if (downloadReason === null) {
+    return; // the user cancelled the download reason dialog
+  }
+  const url = withDownloadReason('/api/v1/chart/data', downloadReason);

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `4423c66`.
   
   Added a format guard so `requestDownloadReason()` runs only when 
`resultFormat` is included in `DOWNLOAD_REASON_FORMATS` (CSV/XLSX), while JSON 
exports bypass the prompt.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



-- 
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]

Reply via email to