Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): add "jobType" to Job.abort, Job.retry and delete_job #1239

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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