Skip to content

Commit

Permalink
fix(client): add "jobType" to Job.abort, Job.retry and delete_job
Browse files Browse the repository at this point in the history
PR Closed: #1239
  • Loading branch information
graczhual committed Apr 6, 2022
1 parent c6d90c1 commit 259312b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions tensorbay/client/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,15 @@ def update(self, until_complete: bool = False) -> None:

def abort(self) -> None:
"""Abort a :class:`Job`."""
self._client.open_api_do("POST", f"jobs/{self.job_id}/abort", self._dataset_id)
self._client.open_api_do(
"POST", f"jobs/{self.job_id}/abort?jobType={self._job_type}", self._dataset_id
)

def retry(self) -> None:
"""Retry a :class:`Job`."""
self._client.open_api_do("POST", f"jobs/{self.job_id}/retry", self._dataset_id)
self._client.open_api_do(
"POST", f"jobs/{self.job_id}/retry?jobType={self._job_type}", self._dataset_id
)


class SquashAndMergeJob(Job):
Expand Down
4 changes: 3 additions & 1 deletion tensorbay/client/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,9 @@ def delete_job(self, job_id: str) -> None:
job_id: The Job id.
"""
self._client.open_api_do("DELETE", f"jobs/{job_id}", self._dataset_id)
self._client.open_api_do(
"DELETE", f"jobs/{job_id}?jobType={self._JOB_TYPE}", self._dataset_id
)


class SquashAndMerge(JobMixin):
Expand Down

0 comments on commit 259312b

Please sign in to comment.