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


##########
superset/charts/data/api.py:
##########
@@ -655,6 +649,24 @@ def _get_data_response(
         slice_: Slice | None = None,
     ) -> Response:
         """Get data response and optionally log is_cached information."""
+        query_context = command.query_context
+        if self._should_stream_before_execution(query_context, expected_rows):
+            # The client already decided to stream this export, so skip the
+            # regular execution: it would run the full query and hold every row
+            # in memory only to discard the result, and the streaming command
+            # runs the query again anyway. On large exports that first pass is
+            # long enough for proxies to drop the idle connection before the
+            # first byte is sent.
+            if not self._has_export_permission():
+                return self.response_403()
+            return self._create_streaming_csv_response(
+                {"query_context": query_context},
+                form_data,
+                filename=filename,
+                expected_rows=expected_rows,
+                slice_=slice_ or query_context.slice_,
+            )

Review Comment:
   **Suggestion:** Skipping `command.execute()` also skips its 
`ChartDataQueryFailedError` and cache-error mapping, so failed large exports no 
longer return the normal chart-data 4xx response.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Sometimes` ยท ๐Ÿท๏ธ `Api mismatch`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ffc91a3ffc88493f9c2d741717cb3cf2&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ffc91a3ffc88493f9c2d741717cb3cf2&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/charts/data/api.py
   **Line:** 662:668
   **Comment:**
        *Api Mismatch: Skipping `command.execute()` also skips its 
`ChartDataQueryFailedError` and cache-error mapping, so failed large exports no 
longer return the normal chart-data 4xx response.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44624&comment_hash=8ffdc02ae3417af8e82b4ce656f1fae7d5813e090ccc46d0a6b0c305ce5d1243&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44624&comment_hash=8ffdc02ae3417af8e82b4ce656f1fae7d5813e090ccc46d0a6b0c305ce5d1243&reaction=dislike'>๐Ÿ‘Ž</a>



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