diff --git a/superset/reports/commands/execute.py b/superset/reports/commands/execute.py index 78ac8aa3a88f8..5ca94ff5db496 100644 --- a/superset/reports/commands/execute.py +++ b/superset/reports/commands/execute.py @@ -671,7 +671,6 @@ def __init__( self._scheduled_dttm = scheduled_dttm def run(self) -> None: - state_found = False for state_cls in self.states_cls: if (self._report_schedule.last_state is None and state_cls.initial) or ( self._report_schedule.last_state in state_cls.current_states @@ -682,9 +681,8 @@ def run(self) -> None: self._scheduled_dttm, self._execution_id, ).next() - state_found = True break - if not state_found: + else: raise ReportScheduleStateNotFoundError()