aminghadersohi commented on code in PR #41127:
URL: https://github.com/apache/superset/pull/41127#discussion_r3614141343
##########
superset/sql_lab.py:
##########
@@ -528,8 +526,15 @@ def execute_sql_statements( # noqa: C901
query.set_extra_json_key("progress", msg)
db.session.commit()
- # Hook to allow environment-specific mutation (usually comments)
to the SQL
- query.executed_sql = database.mutate_sql_based_on_config(block)
+ # Hook to allow environment-specific mutation (usually comments)
to the SQL.
+ # `is_split` reflects whether this block is an individual
statement: when
+ # the engine runs everything as one block the SQL is not split,
otherwise
+ # each block is a single split-out statement. This lets
`MUTATE_AFTER_SPLIT`
+ # decide correctly whether the mutator fires here.
+ query.executed_sql = database.mutate_sql_based_on_config(
+ block,
+ is_split=not db_engine_spec.run_multiple_statements_as_one,
Review Comment:
NIT (pre-existing, not a regression): this per-block mutate call has no
empty-statement guard, unlike the joined-block path in
`build_statement_blocks`. In the `MUTATE_AFTER_SPLIT=True` + split-engine case
(this line's branch), a mutator that strips one of several already-split
statements to nothing reaches `execute_query` as an empty block instead of
raising a clean `INVALID_SQL_ERROR`. Same gap existed before this PR; narrow
edge case, not blocking.
--
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]