mistercrunch commented on code in PR #30177:
URL: https://github.com/apache/superset/pull/30177#discussion_r1750551442
##########
superset/sql_parse.py:
##########
@@ -522,6 +530,43 @@ def _extract_tables_from_statement(
dialect = SQLGLOT_DIALECTS.get(engine)
return extract_tables_from_statement(parsed, dialect)
+ def is_dml(self) -> bool:
+ """
+ Check if the statement is DML.
+
+ :return: True if the statement is DML
+ """
+ for node in self._parsed.walk():
+ if isinstance(
+ node,
+ (
+ exp.Insert,
+ exp.Update,
+ exp.Delete,
+ exp.Merge,
+ exp.Create,
Review Comment:
yes I would. Here's what it says currently -> <img width="459"
alt="Screenshot 2024-09-09 at 9 11 58 AM"
src="https://github.com/user-attachments/assets/e200b357-3283-4f01-a053-e9c2112d6aaf">
`Allow DML and DDL` - could be good to unpack the acronyms in the tooltip
too. "Allow the execution of DDL (Data Definition Language, ie CREATE, DROP,
TRUNCATE, ...) and DML (Data Modification Language, ie INSERT, UPDATE, DELETE,
...) {...}"
--
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]