chore: remove sqlparse (#33564)

This commit is contained in:
Beto Dealmeida
2025-06-04 19:31:41 -04:00
committed by GitHub
parent a7aa8f7cef
commit a26e1d822a
77 changed files with 488 additions and 3133 deletions

View File

@@ -57,11 +57,11 @@ from sqlalchemy.sql import literal_column, quoted_name, text
from sqlalchemy.sql.expression import ColumnClause, Select, TextClause
from sqlalchemy.types import TypeEngine
from superset import db, sql_parse
from superset import db
from superset.constants import QUERY_CANCEL_KEY, TimeGrain as TimeGrainConstants
from superset.databases.utils import get_table_metadata, make_url_safe
from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
from superset.exceptions import DisallowedSQLFunction, OAuth2Error, OAuth2RedirectError
from superset.exceptions import OAuth2Error, OAuth2RedirectError
from superset.sql.parse import (
BaseSQLStatement,
LimitMethod,
@@ -1767,14 +1767,6 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
:param kwargs: kwargs to be passed to cursor.execute()
:return:
"""
if not cls.allows_sql_comments:
query = sql_parse.strip_comments_from_sql(query, engine=cls.engine)
disallowed_functions = current_app.config["DISALLOWED_SQL_FUNCTIONS"].get(
cls.engine, set()
)
if sql_parse.check_sql_functions_exist(query, disallowed_functions, cls.engine):
raise DisallowedSQLFunction(disallowed_functions)
if cls.arraysize:
cursor.arraysize = cls.arraysize
try: