Skip to content

Commit

Permalink
chore: Bump sqlparse to 0.4.4 (#24045)
Browse files Browse the repository at this point in the history
Co-authored-by: sebastianliebscher <[email protected]>
  • Loading branch information
EugeneTorap and sebastianliebscher authored May 23, 2023
1 parent 7891cea commit a7f9c66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ sqlalchemy-utils==0.38.3
# via
# apache-superset
# flask-appbuilder
sqlparse==0.4.3
sqlparse==0.4.4
# via apache-superset
sshtunnel==0.4.0
# via apache-superset
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def get_git_sha() -> str:
"slack_sdk>=3.19.0, <4",
"sqlalchemy>=1.4, <2",
"sqlalchemy-utils>=0.38.3, <0.39",
"sqlparse>=0.4.3, <0.5",
"sqlparse>=0.4.4, <0.5",
"tabulate>=0.8.9, <0.9",
"typing-extensions>=4, <5",
"waitress; sys_platform == 'win32'",
Expand Down
16 changes: 8 additions & 8 deletions superset/sql_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import sqlparse
from sqlalchemy import and_
from sqlparse import keywords
from sqlparse.lexer import Lexer
from sqlparse.sql import (
Identifier,
IdentifierList,
Expand Down Expand Up @@ -59,15 +61,13 @@

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):
Expand Down

0 comments on commit a7f9c66

Please sign in to comment.