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



##########
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:
       done




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to