mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
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:
committed by
GitHub
parent
002518ba49
commit
cc3a625a4b
@@ -76,20 +76,20 @@ class DatabaseModelTestCase(SupersetTestCase):
|
||||
table_name = 'energy_usage'
|
||||
sql = main_db.select_star(
|
||||
table_name, show_cols=False, latest_partition=False)
|
||||
expected = textwrap.dedent("""\
|
||||
expected = textwrap.dedent(f"""\
|
||||
SELECT *
|
||||
FROM {table_name}
|
||||
LIMIT 100""".format(**locals()))
|
||||
LIMIT 100""")
|
||||
assert sql.startswith(expected)
|
||||
|
||||
sql = main_db.select_star(
|
||||
table_name, show_cols=True, latest_partition=False)
|
||||
expected = textwrap.dedent("""\
|
||||
expected = textwrap.dedent(f"""\
|
||||
SELECT source,
|
||||
target,
|
||||
value
|
||||
FROM energy_usage
|
||||
LIMIT 100""".format(**locals()))
|
||||
LIMIT 100""")
|
||||
assert sql.startswith(expected)
|
||||
|
||||
def test_grains_dict(self):
|
||||
|
||||
Reference in New Issue
Block a user