mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[flake8] Resolving Q??? errors (#3847)
This commit is contained in:
committed by
Maxime Beauchemin
parent
630604bc6b
commit
ac57780607
@@ -20,7 +20,7 @@ class SupersetQuery(object):
|
||||
self._table_names = set()
|
||||
self._alias_names = set()
|
||||
# TODO: multistatement support
|
||||
logging.info("Parsing with sqlparse statement {}".format(self.sql))
|
||||
logging.info('Parsing with sqlparse statement {}'.format(self.sql))
|
||||
self._parsed = sqlparse.parse(self.sql)
|
||||
for statement in self._parsed:
|
||||
self.__extract_from_token(statement)
|
||||
@@ -50,7 +50,7 @@ class SupersetQuery(object):
|
||||
@staticmethod
|
||||
def __get_full_name(identifier):
|
||||
if len(identifier.tokens) > 1 and identifier.tokens[1].value == '.':
|
||||
return "{}.{}".format(identifier.tokens[0].value,
|
||||
return '{}.{}'.format(identifier.tokens[0].value,
|
||||
identifier.tokens[2].value)
|
||||
return identifier.get_real_name()
|
||||
|
||||
@@ -101,7 +101,7 @@ class SupersetQuery(object):
|
||||
sql = self.stripped()
|
||||
if overwrite:
|
||||
exec_sql = 'DROP TABLE IF EXISTS {table_name};\n'
|
||||
exec_sql += "CREATE TABLE {table_name} AS \n{sql}"
|
||||
exec_sql += 'CREATE TABLE {table_name} AS \n{sql}'
|
||||
return exec_sql.format(**locals())
|
||||
|
||||
def __extract_from_token(self, token):
|
||||
|
||||
Reference in New Issue
Block a user