Use py3's f-strings instead of s.format(**locals()) (#6448)

* Use py3's f-strings instead of s.format(**locals())

In light of the bug reported here
https://github.com/apache/incubator-superset/issues/6347, which seems
like an odd `.format()` issue in py3, I greped and replaced all
instances of `.format(**locals())` using py3's f-strings

* lint

* fix tests
This commit is contained in:
Maxime Beauchemin
2018-12-02 13:50:49 -08:00
committed by GitHub
parent 002518ba49
commit cc3a625a4b
14 changed files with 73 additions and 75 deletions

View File

@@ -100,9 +100,9 @@ class SupersetQuery(object):
exec_sql = ''
sql = self.stripped()
if overwrite:
exec_sql = 'DROP TABLE IF EXISTS {table_name};\n'
exec_sql += 'CREATE TABLE {table_name} AS \n{sql}'
return exec_sql.format(**locals())
exec_sql = f'DROP TABLE IF EXISTS {table_name};\n'
exec_sql += f'CREATE TABLE {table_name} AS \n{sql}'
return exec_sql
def __extract_from_token(self, token):
if not hasattr(token, 'tokens'):