mirror of
https://github.com/apache/superset.git
synced 2026-04-23 01:55:09 +00:00
refactor: remove more sqlparse (#31032)
This commit is contained in:
@@ -104,11 +104,6 @@ class KustoSqlEngineSpec(BaseEngineSpec): # pylint: disable=abstract-method
|
||||
return f"""CONVERT(DATETIME, '{datetime_formatted}', 126)"""
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def is_readonly_query(cls, parsed_query: ParsedQuery) -> bool:
|
||||
"""Pessimistic readonly, 100% sure statement won't mutate anything"""
|
||||
return parsed_query.sql.lower().startswith("select")
|
||||
|
||||
|
||||
class KustoKqlEngineSpec(BaseEngineSpec): # pylint: disable=abstract-method
|
||||
limit_method = LimitMethod.WRAP_SQL
|
||||
@@ -158,15 +153,6 @@ class KustoKqlEngineSpec(BaseEngineSpec): # pylint: disable=abstract-method
|
||||
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def is_readonly_query(cls, parsed_query: ParsedQuery) -> bool:
|
||||
"""
|
||||
Pessimistic readonly, 100% sure statement won't mutate anything.
|
||||
"""
|
||||
return KustoKqlEngineSpec.is_select_query(
|
||||
parsed_query
|
||||
) or parsed_query.sql.startswith(".show")
|
||||
|
||||
@classmethod
|
||||
def is_select_query(cls, parsed_query: ParsedQuery) -> bool:
|
||||
return not parsed_query.sql.startswith(".")
|
||||
|
||||
Reference in New Issue
Block a user