You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/12/08 13:41:30 UTC
[GitHub] [superset] fcomuniz commented on issue #20565: Unchecking 'Allow DML' returns incorrect errors and blocks more than DML statements
fcomuniz commented on issue #20565:
URL: https://github.com/apache/superset/issues/20565#issuecomment-1342755696
I investigated a similar issue, and it seems to come from the check if the statement is select
On superset.sql_parse.ParsedQuery.is_select function, for the presented query, the type of the query is Unknown, and goes untl the check
```
if any(token.ttype == DDL for token in parsed[0]) or any(
token.ttype == DML and token.value != "SELECT" for token in parsed[0]
):
return False
```
Which checks for the token.value !="SELECT", which means it only checks for the same casing, so a lowercase "select" will incorrectly return a False for the is_select function
i believe the check should be `token.normalized != "SELECT"`
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org