chore: Bump sqlparse to 0.4.4 (#24045)

Co-authored-by: sebastianliebscher <liebscher.sebastian@protonmail.ch>
This commit is contained in:
EugeneTorap
2023-05-23 10:15:24 +03:00
committed by GitHub
parent 7891cea7f7
commit a7f9c66e57
3 changed files with 10 additions and 10 deletions

View File

@@ -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):