hainenber commented on code in PR #44624:
URL: https://github.com/apache/superset/pull/44624#discussion_r4113826777
##########
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:
This is valid. @aipiJuancho can you help bringing this code block under the
try-catch section below?
--
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]