Skip to content

Commit

Permalink
Remove uncalled assert
Browse files Browse the repository at this point in the history
  • Loading branch information
yutaro-oguri committed Dec 1, 2023
1 parent 0ab310b commit d352a31
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kannon/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def build(self, root_task: gokart.TaskOnKart) -> None:
continue
if task.make_unique_id() in running_task_ids:
# check if task is still running on child job
assert self._check_child_task_status(task), f"Child task {self._gen_task_info(task)} failed."
self._check_child_task_status(task), f"Child task {self._gen_task_info(task)} failed."
logger.info(f"Task {self._gen_task_info(task)} is still running on child job.")
task_queue.append(task) # re-enqueue task to check if it is done
continue
Expand Down Expand Up @@ -175,7 +175,7 @@ def _gen_task_info(task: gokart.TaskOnKart) -> str:
def _gen_pkl_path(task: gokart.TaskOnKart) -> str:
return os.path.join(task.workspace_directory, 'kannon', f'task_obj_{task.make_unique_id()}.pkl')

def _check_child_task_status(self, task: TaskOnBullet) -> bool:
def _check_child_task_status(self, task: TaskOnBullet):
if task.make_unique_id() not in self.task_id_to_job_name:
raise ValueError(f"Task {self._gen_task_info(task)} is not found in `task_id_to_job_name`")
job_name = self.task_id_to_job_name[task.make_unique_id()]
Expand All @@ -186,7 +186,6 @@ def _check_child_task_status(self, task: TaskOnBullet) -> bool:
)
if job_status == JobStatus.FAILED:
raise RuntimeError(f"Task {self._gen_task_info(task)} on job {job_name} has failed.")
return True

def _is_executable(self, task: gokart.TaskOnKart) -> bool:
children = flatten(task.requires())
Expand Down

0 comments on commit d352a31

Please sign in to comment.