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 2021/01/13 11:03:37 UTC

[GitHub] [superset] dpgaspar commented on a change in pull request #12490: test: /postgres engine spec test coverage

dpgaspar commented on a change in pull request #12490:
URL: https://github.com/apache/superset/pull/12490#discussion_r556436567



##########
File path: superset/db_engine_specs/postgres.py
##########
@@ -78,8 +78,13 @@ def get_allow_cost_estimate(cls, extra: Dict[str, Any]) -> bool:
 
     @classmethod
     def estimate_statement_cost(cls, statement: str, cursor: Any) -> Dict[str, Any]:
+        from psycopg2 import errors
+
         sql = f"EXPLAIN {statement}"
-        cursor.execute(sql)
+        try:
+            cursor.execute(sql)
+        except errors.SyntaxError as err:

Review comment:
       I think so too




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



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