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/14 08:03:59 UTC

[GitHub] [superset] dpgaspar commented on a diff in pull request #21802: chore: additional logging in alerts and reports

dpgaspar commented on code in PR #21802:
URL: https://github.com/apache/superset/pull/21802#discussion_r995469357


##########
superset/tasks/scheduler.py:
##########
@@ -85,10 +85,12 @@ def execute(report_schedule_id: int, scheduled_dttm: str) -> None:
         logger.exception(
             "An unexpected occurred while executing the report: %s", task_id
         )
+        execute.update_state(state="FAILURE")

Review Comment:
   Can you add a test to assert this?



##########
superset/utils/core.py:
##########
@@ -1020,6 +1021,7 @@ def send_mime_email(
     if smtp_user and smtp_password:
         smtp.login(smtp_user, smtp_password)
     logger.debug("Sent an email to %s", str(e_to))
+    logger.info("Sent email notification content is %s", mime_msg.as_string())

Review Comment:
   don't think we should log the mime_msg itself 



##########
superset/reports/notifications/email.py:
##########
@@ -207,6 +207,8 @@ def send(self) -> None:
                 dryrun=False,
                 header_data=content.header_data,
             )
-            logger.info("Report sent to email")
+            logger.info(
+                "Report sent to email, notification content is %s", content.header_data

Review Comment:
   checked `HeaderDataType` is safe to log. 



##########
superset/tasks/scheduler.py:
##########
@@ -85,10 +85,12 @@ def execute(report_schedule_id: int, scheduled_dttm: str) -> None:
         logger.exception(
             "An unexpected occurred while executing the report: %s", task_id
         )
+        execute.update_state(state="FAILURE")
     except CommandException:
         logger.exception(
             "A downstream exception occurred while generating" " a report: %s", task_id
         )
+        execute.update_state(state="FAILURE")

Review Comment:
   can you add a test to assert this?



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