dpgaspar commented on code in PR #28639:
URL: https://github.com/apache/superset/pull/28639#discussion_r1611291007
##########
superset/sql_parse.py:
##########
@@ -223,6 +224,19 @@ def get_cte_remainder_query(sql: str) -> tuple[str | None,
str]:
return cte, remainder
+def check_sql_functions_exist(
+ sql: str, function_list: set[str], engine: str | None = None
+) -> bool:
+ """
+ Check if the SQL statement contains any of the specified functions.
+
+ :param sql: The SQL statement
+ :param function_list: The list of functions to search for
+ :param engine: The engine to use for parsing the SQL statement
+ """
+ return ParsedQuery(sql, engine=engine).check_functions_exist(function_list)
Review Comment:
Happy to do it myself, can I just not use sqlparse? implement something
using the same pattern as `extract_tables_from_statement`?
--
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]