mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: Bump sqlparse to 0.4.4 (#24045)
Co-authored-by: sebastianliebscher <liebscher.sebastian@protonmail.ch>
This commit is contained in:
@@ -23,6 +23,8 @@ from urllib import parse
|
||||
|
||||
import sqlparse
|
||||
from sqlalchemy import and_
|
||||
from sqlparse import keywords
|
||||
from sqlparse.lexer import Lexer
|
||||
from sqlparse.sql import (
|
||||
Identifier,
|
||||
IdentifierList,
|
||||
@@ -59,15 +61,13 @@ CTE_PREFIX = "CTE__"
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# TODO: Workaround for https://github.com/andialbrecht/sqlparse/issues/652.
|
||||
sqlparse.keywords.SQL_REGEX.insert(
|
||||
0,
|
||||
(
|
||||
re.compile(r"'(''|\\\\|\\|[^'])*'", sqlparse.keywords.FLAGS).match,
|
||||
sqlparse.tokens.String.Single,
|
||||
),
|
||||
)
|
||||
# configure the Lexer to extend sqlparse
|
||||
# reference: https://sqlparse.readthedocs.io/en/stable/extending/
|
||||
lex = Lexer.get_default_instance()
|
||||
sqlparser_sql_regex = keywords.SQL_REGEX
|
||||
sqlparser_sql_regex.insert(25, (r"'(''|\\\\|\\|[^'])*'", sqlparse.tokens.String.Single))
|
||||
lex.set_SQL_REGEX(sqlparser_sql_regex)
|
||||
|
||||
|
||||
class CtasMethod(str, Enum):
|
||||
|
||||
Reference in New Issue
Block a user