mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore(report): Use for/else clause (#24107)
This commit is contained in:
@@ -670,7 +670,6 @@ class ReportScheduleStateMachine: # pylint: disable=too-few-public-methods
|
||||
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
|
||||
@@ -681,9 +680,8 @@ class ReportScheduleStateMachine: # pylint: disable=too-few-public-methods
|
||||
self._scheduled_dttm,
|
||||
self._execution_id,
|
||||
).next()
|
||||
state_found = True
|
||||
break
|
||||
if not state_found:
|
||||
else:
|
||||
raise ReportScheduleStateNotFoundError()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user