You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/05/14 19:49:06 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #7504: Add try/catch to cursor.fetchall()

villebro commented on a change in pull request #7504: Add try/catch to cursor.fetchall()
URL: https://github.com/apache/incubator-superset/pull/7504#discussion_r283970731
 
 

 ##########
 File path: superset/models/core.py
 ##########
 @@ -866,7 +866,10 @@ def _log_query(sql):
                 for sql in sqls[:-1]:
                     _log_query(sql)
                     self.db_engine_spec.execute(cursor, sql)
-                    cursor.fetchall()
+                    try:
+                        cursor.fetchall()
+                    except BaseException:
+                        pass
 
 Review comment:
   Hmm, I might be missing something obvious here, but why are we calling `fetchall()` if we're not even storing the return value anywhere? Wouldn't it be enough to just call `exexute()` here and remove the fetch all together?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org