gabotorresruiz commented on code in PR #44949:
URL: https://github.com/apache/superset/pull/44949#discussion_r4190398969


##########
superset/mcp_service/sql_lab/tool/execute_sql.py:
##########
@@ -396,6 +400,8 @@ def _convert_to_response(result: QueryResult) -> 
ExecuteSqlResponse:
         rows = last_data_stmt.data.rows
         columns = last_data_stmt.data.columns
         row_count = len(last_data_stmt.data.rows)
+        # Keep the promoted result only at the top level, not in both places.
+        last_data_stmt.data = None

Review Comment:
   Just a small NIT, not a blocker: after this a promoted statement and a 
no-data statement (`SET`, DML) both come back as `data: null`, so a client has 
to infer from `original_sql` which entry the top-level `rows` belong to. If 
that ever becomes a problem, a tiny `data_at_top_level: bool` on 
`StatementInfo` would make it explicit. Fine to leave as is.



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