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 2022/01/28 14:04:45 UTC

[GitHub] [superset] villebro commented on a change in pull request #18207: fix(postgresql): fix TEIID error when getting postgresql cancellation token

villebro commented on a change in pull request #18207:
URL: https://github.com/apache/superset/pull/18207#discussion_r794530449



##########
File path: superset/db_engine_specs/postgres.py
##########
@@ -289,9 +289,12 @@ def get_cancel_query_id(cls, cursor: Any, query: Query) -> Optional[str]:
         :param query: Query instance
         :return: Postgres PID
         """
-        cursor.execute("SELECT pg_backend_pid()")
-        row = cursor.fetchone()
-        return row[0]
+        try:
+            cursor.execute("SELECT pg_backend_pid()")
+            row = cursor.fetchone()
+            return row[0]
+        except Exception:

Review comment:
       Minor improvement proposal: is there a more specific exception type that we could be catching here?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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