superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Update core.py (#5320)
Date Sun, 01 Jul 2018 15:49:59 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new bfa9fff  Update core.py (#5320)
bfa9fff is described below

commit bfa9ffff3cf3681c3fd6920faa236ca6e5418ddb
Author: fly-high-bj <fly.high.bj@outlook.com>
AuthorDate: Sun Jul 1 08:49:56 2018 -0700

    Update core.py (#5320)
    
    With Python 3.7.0, 'async' and 'await' become reserved words, which cause invalid syntax
error when running core.py. Renamed 'async' var to 'async_'
---
 superset/views/core.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index 7c39f1c..9756b5b 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2499,7 +2499,7 @@ class Superset(BaseSupersetView):
     @log_this
     def sql_json(self):
         """Runs arbitrary sql and returns and json"""
-        async = request.form.get('runAsync') == 'true'
+        async_ = request.form.get('runAsync') == 'true'
         sql = request.form.get('sql')
         database_id = request.form.get('database_id')
         schema = request.form.get('schema') or None
@@ -2535,7 +2535,7 @@ class Superset(BaseSupersetView):
             select_as_cta=request.form.get('select_as_cta') == 'true',
             start_time=utils.now_as_float(),
             tab_name=request.form.get('tab'),
-            status=QueryStatus.PENDING if async else QueryStatus.RUNNING,
+            status=QueryStatus.PENDING if async_ else QueryStatus.RUNNING,
             sql_editor_id=request.form.get('sql_editor_id'),
             tmp_table_name=tmp_table_name,
             user_id=int(g.user.get_id()),
@@ -2560,7 +2560,7 @@ class Superset(BaseSupersetView):
                 'Template rendering failed: {}'.format(utils.error_msg_from_exception(e)))
 
         # Async request.
-        if async:
+        if async_:
             logging.info('Running query on a Celery worker')
             # Ignore the celery future object and the request may time out.
             try:


Mime
View raw message