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/10/12 17:47:24 UTC

[GitHub] [superset] betodealmeida commented on a diff in pull request #21787: chore: stop logging "SyntaxError" as exceptions

betodealmeida commented on code in PR #21787:
URL: https://github.com/apache/superset/pull/21787#discussion_r993731430


##########
superset/sql_lab.py:
##########
@@ -313,8 +313,6 @@ def execute_sql_statement(  # pylint: disable=too-many-arguments,too-many-statem
         if query.status == QueryStatus.STOPPED:
             raise SqlLabQueryStoppedException() from ex
 
-        logger.error("Query %d: %s", query.id, type(ex), exc_info=True)
-        logger.debug("Query %d: %s", query.id, ex)

Review Comment:
   Can we keep the debug? Or does it also show up as exceptions?



##########
superset/sqllab/command.py:
##########
@@ -132,6 +132,7 @@ def run(  # pylint: disable=too-many-statements,useless-suppression
                 ) from ex
             raise ex
         except Exception as ex:
+            logger.error("Query %d: %s", query.id, type(ex), exc_info=True)

Review Comment:
   If we need the exception info in general it's better to use `logger.exception`, as it does that automatically:
   ```suggestion
               logger.exception("Query %d: %s", query.id, type(ex))
   ```



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