randalee commented on issue #13430:
URL: https://github.com/apache/superset/issues/13430#issuecomment-911429416


   Hi. @anilvpatel21 
   I'm facing the same problem as you. 
   
   I had no choice but to check the code because there was no writing about 
this content, and I corrected some of the codes and solved them.
   
   
https://github.com/apache/superset/blob/master/superset/reports/commands/execute.py#L535
   
   Modified function 
"superset.reports.commands.execute.ReportSuccessState.next":
   1. remove 'ReportScheduleAlertEndGracePeriodError'
   2. add alert check if the alert is triggered ( ref - 
ReportNotTriggeredErrorState class)
   
   ```.python
       def next(self) -> None:
           self.set_state_and_log(ReportState.WORKING)
           if self._report_schedule.type == ReportScheduleType.ALERT:
               if self.is_in_grace_period():
                   self.set_state_and_log(
                       ReportState.GRACE,
                       error_message=str(ReportScheduleAlertGracePeriodError()),
                   )
                   return
               # If it's an alert check if the alert is triggered
               if not AlertCommand(self._report_schedule).run():
                   self.set_state_and_log(ReportState.NOOP)
                   return
           try:
               self.send()
               self.set_state_and_log(ReportState.SUCCESS)
           except CommandException as ex:
               self.set_state_and_log(ReportState.ERROR, error_message=str(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: [email protected]

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