Explorar el Código

[sqlalchemy] fix presto progress error message when query is short

penggongkui hace 4 años
padre
commit
d462f3010b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py

@@ -296,7 +296,7 @@ class SqlAlchemyApi(Api):
 
     if connection:
       cursor = connection['result'].cursor
-      if self.options['url'].startswith('presto://') and cursor and cursor.poll():
+      if self.options['url'].startswith('presto://') and cursor and cursor._state == cursor._STATE_RUNNING:
         response['status'] = 'running'
       elif snippet['result']['handle']['has_result_set']:
         response['status'] = 'available'