fix: adds the ability to disallow SQL functions per engine (#28639)

This commit is contained in:
Daniel Vaz Gaspar
2024-05-29 10:51:28 +01:00
committed by GitHub
parent 6575cacc5d
commit 5dfbab5424
7 changed files with 119 additions and 15 deletions

View File

@@ -358,6 +358,21 @@ class OAuth2Error(SupersetErrorException):
)
class DisallowedSQLFunction(SupersetErrorException):
"""
Disallowed function found on SQL statement
"""
def __init__(self, functions: set[str]):
super().__init__(
SupersetError(
message=f"SQL statement contains disallowed function(s): {functions}",
error_type=SupersetErrorType.SYNTAX_ERROR,
level=ErrorLevel.ERROR,
)
)
class CreateKeyValueDistributedLockFailedException(Exception):
"""
Exception to signalize failure to acquire lock.