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

Method __init__

superset/sql_parse.py:104–116  ·  view source on GitHub ↗
(self, sql_statement: str, strip_comments: bool = False)

Source from the content-addressed store, hash-verified

102
103class ParsedQuery:
104 def __init__(self, sql_statement: str, strip_comments: bool = False):
105 if strip_comments:
106 sql_statement = sqlparse.format(sql_statement, strip_comments=True)
107
108 self.sql: str = sql_statement
109 self._tables: Set[Table] = set()
110 self._alias_names: Set[str] = set()
111 self._limit: Optional[int] = None
112
113 logger.debug("Parsing with sqlparse statement: %s", self.sql)
114 self._parsed = sqlparse.parse(self.stripped())
115 for statement in self._parsed:
116 self._limit = _extract_limit_from_query(statement)
117
118 @property
119 def tables(self) -> Set[Table]:

Callers

nothing calls this directly

Calls 2

strippedMethod · 0.95

Tested by

no test coverage detected