mirror of
https://github.com/apache/superset.git
synced 2026-04-07 18:35:15 +00:00
* fix: Workaround for sqlparse issue #652 * Update superset/sql_parse.py Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * Update sql_parse.py Co-authored-by: John Bodley <john.bodley@airbnb.com> Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import logging
|
||||
import re
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import List, Optional, Set
|
||||
@@ -41,6 +42,16 @@ 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,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class CtasMethod(str, Enum):
|
||||
TABLE = "TABLE"
|
||||
VIEW = "VIEW"
|
||||
|
||||
Reference in New Issue
Block a user