villebro commented on a change in pull request #13153:
URL: https://github.com/apache/superset/pull/13153#discussion_r577352913
##########
File path: superset/db_engine_specs/base.py
##########
@@ -933,6 +933,9 @@ def execute(cls, cursor: Any, query: str, **kwargs: Any) ->
None:
:param kwargs: kwargs to be passed to cursor.execute()
:return:
"""
+ if not cls.allows_sql_comments:
+ query = sql_parse.ParsedQuery(query).strip_comments()
Review comment:
I checked the description of `SQL_QUERY_MUTATOR`, and it only mentions
that it's typically used to add comments - but not strictly restricted to that.
If we want to block mutation from happening, we should rename the property to
`allows_query_mutator` or similar to highlight that we're blocking that from
happening rather than just stripping comments.
As this is only affecting a single engine, I feel this is the least invasive
solution for now - we can always change this later if the overhead becomes an
issue.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]