Skip to content

Commit

Permalink
feat(client): adapt OpenAPI listJob
Browse files Browse the repository at this point in the history
  • Loading branch information
graczhual committed Dec 21, 2021
1 parent 323eadb commit fa93b51
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tensorbay/client/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,13 @@ def _delete_job(self, job_id: str) -> None:
"""

def _generate_jobs(
def _list_jobs(
self,
job_type: str,
status: Optional[str] = None,
offset: int = 0,
limit: int = 128,
) -> Generator[Dict[str, Any], None, int]:
) -> Dict[str, Any]:
"""Get a generator of :class:`Job`.
Arguments:
Expand All @@ -659,10 +659,14 @@ def _generate_jobs(
offset: The offset of the page.
limit: The limit of the page.
Return:
The generator of job info.
Returns:
The dict of job info list.
"""
params = {"jobType": job_type, "status": status, "offset": offset, "limit": limit}

response = self._client.open_api_do("GET", "jobs", self._dataset_id, params=params)
return response.json() # type: ignore[no-any-return]


class SquashAndMerge(JobMixin):
Expand Down

0 comments on commit fa93b51

Please sign in to comment.