mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: Python3.11 (str, Enum) issue (#24803)
This commit is contained in:
@@ -18,7 +18,6 @@ import logging
|
||||
import re
|
||||
from collections.abc import Iterator
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import Any, cast, Optional
|
||||
from urllib import parse
|
||||
|
||||
@@ -49,6 +48,7 @@ from sqlparse.tokens import (
|
||||
from sqlparse.utils import imt
|
||||
|
||||
from superset.exceptions import QueryClauseValidationException
|
||||
from superset.utils.backports import StrEnum
|
||||
|
||||
try:
|
||||
from sqloxide import parse_sql as sqloxide_parse
|
||||
@@ -71,7 +71,7 @@ sqlparser_sql_regex.insert(25, (r"'(''|\\\\|\\|[^'])*'", sqlparse.tokens.String.
|
||||
lex.set_SQL_REGEX(sqlparser_sql_regex)
|
||||
|
||||
|
||||
class CtasMethod(str, Enum):
|
||||
class CtasMethod(StrEnum):
|
||||
TABLE = "TABLE"
|
||||
VIEW = "VIEW"
|
||||
|
||||
@@ -483,7 +483,7 @@ def sanitize_clause(clause: str) -> str:
|
||||
return clause
|
||||
|
||||
|
||||
class InsertRLSState(str, Enum):
|
||||
class InsertRLSState(StrEnum):
|
||||
"""
|
||||
State machine that scans for WHERE and ON clauses referencing tables.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user