Browse Source

HUE-8740 [sqlalchemy] Remove execution_options(stream_results=True)

Create a server side cursors (which only supports SELECT).
Moreover, it is only by the psycopg2, mysqldb and pymysql dialects
and is not needed in practice.
Romain 5 years ago
parent
commit
bb51358888
1 changed files with 2 additions and 2 deletions
  1. 2 2
      desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py

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

@@ -158,7 +158,7 @@ class SqlAlchemyApi(Api):
     engine = self._create_engine()
     engine = self._create_engine()
     connection = engine.connect()
     connection = engine.connect()
 
 
-    result = connection.execution_options(stream_results=True).execute(snippet['statement'])
+    result = connection.execute(snippet['statement'])
 
 
     cache = {
     cache = {
       'connection': connection,
       'connection': connection,
@@ -403,7 +403,7 @@ class Assist(object):
 
 
     connection = self.engine.connect()
     connection = self.engine.connect()
     try:
     try:
-      result = connection.execution_options(stream_results=True).execute(statement)
+      result = connection.execute(statement)
       return result.cursor.description, result.fetchall()
       return result.cursor.description, result.fetchall()
     finally:
     finally:
       connection.close()
       connection.close()