wangfenjin commented on code in PR #43641:
URL: https://github.com/apache/superset/pull/43641#discussion_r3878655804
##########
superset/sql/execution/executor.py:
##########
@@ -817,14 +817,9 @@ def _check_disallowed_functions(self, script: SQLScript)
-> set[str] | None:
if not engine_disallowed:
return None
- # Check each statement for disallowed functions
- found = set()
- for statement in script.statements:
- # Use the statement's AST to check for function calls
- statement_str = str(statement).upper()
- for func in engine_disallowed:
- if func.upper() in statement_str:
- found.add(func)
+ found = {
+ func for func in engine_disallowed if
script.check_functions_present({func})
+ }
Review Comment:
Addressed in 4c2b2ea871. I added `get_disallowed_functions()` to collect
present AST function names once per statement and return the denylist
intersection in its original form. The executor now passes the complete engine
denylist in one call, while the existing boolean API keeps its multi-statement
short-circuit behavior. A spy regression test verifies one statement-level
traversal for the full denylist. Focused tests: 26 passed; staged pre-commit:
passed.
--
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]