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
  • Loading branch information
graczhual committed Apr 6, 2022
1 parent 534ff59 commit b734ebd
Show file tree
Hide file tree
Showing 2 changed files with 10 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
5 changes: 4 additions & 1 deletion tensorbay/client/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ class JobMixin:
_dataset_id: str
_client: Client
_status: Status
_JOB_TYPE: str

def _create_job(
self,
Expand Down Expand Up @@ -616,7 +617,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 b734ebd

Please sign in to comment.