MCPcopy
hub / github.com/apache/superset / is_explain

Method is_explain

superset/sql_parse.py:146–153  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

144 return len(parsed) == 1 and parsed[0].get_type() == "SELECT"
145
146 def is_explain(self) -> bool:
147 # Remove comments
148 statements_without_comments = sqlparse.format(
149 self.stripped(), strip_comments=True
150 )
151
152 # Explain statements will only be the first statement
153 return statements_without_comments.startswith("EXPLAIN")
154
155 def is_show(self) -> bool:
156 # Remove comments

Callers 3

test_explainMethod · 0.95
test_is_explainMethod · 0.95
is_readonly_queryMethod · 0.80

Calls 1

strippedMethod · 0.95

Tested by 2

test_explainMethod · 0.76
test_is_explainMethod · 0.76