Bug: fixing async syntax for python 3.7 (#5759)

* Bug: fixing async syntax for python 3.7

Rename async to async_ so superset installs for python 3.7.

* Addressing PR comments. Use kwargs instead of explicitly specifying async_ so downstream engines (e.g. PyHive) that supports async can choose to use the async_ in pythonwq3.7 and async in <=python3.6

* addressing additional pr comments
This commit is contained in:
Christine Chambers
2018-08-28 17:40:45 -07:00
committed by Beto Dealmeida
parent 48d220c03a
commit ae3fb04036
3 changed files with 9 additions and 8 deletions

View File

@@ -123,14 +123,14 @@ class CeleryTestCase(SupersetTestCase):
)
def run_sql(self, db_id, sql, client_id, cta='false', tmp_table='tmp',
async='false'):
async_='false'):
self.login()
resp = self.client.post(
'/superset/sql_json/',
data=dict(
database_id=db_id,
sql=sql,
async=async,
runAsync=async_,
select_as_cta=cta,
tmp_table_name=tmp_table,
client_id=client_id,
@@ -183,7 +183,7 @@ class CeleryTestCase(SupersetTestCase):
eng = main_db.get_sqla_engine()
sql_where = "SELECT name FROM ab_role WHERE name='Admin'"
result = self.run_sql(
main_db.id, sql_where, '4', async='true', tmp_table='tmp_async_1',
main_db.id, sql_where, '4', async_='true', tmp_table='tmp_async_1',
cta='true')
assert result['query']['state'] in (
QueryStatus.PENDING, QueryStatus.RUNNING, QueryStatus.SUCCESS)
@@ -211,7 +211,7 @@ class CeleryTestCase(SupersetTestCase):
eng = main_db.get_sqla_engine()
sql_where = "SELECT name FROM ab_role WHERE name='Alpha' LIMIT 1"
result = self.run_sql(
main_db.id, sql_where, '5', async='true', tmp_table='tmp_async_2',
main_db.id, sql_where, '5', async_='true', tmp_table='tmp_async_2',
cta='true')
assert result['query']['state'] in (
QueryStatus.PENDING, QueryStatus.RUNNING, QueryStatus.SUCCESS)