betodealmeida commented on code in PR #30518:
URL: https://github.com/apache/superset/pull/30518#discussion_r1999490830
##########
superset/models/core.py:
##########
@@ -666,6 +667,10 @@ def _log_query(sql: str) -> None:
with self.get_raw_connection(catalog=catalog, schema=schema) as conn:
cursor = conn.cursor()
df = None
+ if sql_statements:
+ for statement in sql_statements:
+ self.db_engine_spec.execute(cursor, statement)
Review Comment:
This doesn't work for all databases, you need to check
`run_multiple_statements_as_one` in the DB engine spec, since some databases
need to run all statements in a single chunk.
I discussed this with @mistercrunch and @rusackas today, I think we first
need to consolidate the SQL execution logic between Explore and SQL Lab.
Explore runs query under the assumption that they have a single statement, and
to change that would require duplicating much of the logic that exists in SQL
Lab.
--
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]