Skip to content

Commit

Permalink
feat(client): use AttrMixin to handle the default values for Job attrs
Browse files Browse the repository at this point in the history
PR Closed: #1182
  • Loading branch information
graczhual committed Dec 24, 2021
1 parent 846bf57 commit 7f4a2a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tensorbay/client/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ class Job(AttrsMixin, ReprMixin): # pylint: disable=too-many-instance-attribute
job_id: str = attr(key=camel)
arguments: Dict[str, Any] = attr()
created_at: int = attr(key=camel)
started_at: Optional[int] = attr(key=camel)
finished_at: Optional[int] = attr(key=camel)
started_at: Optional[int] = attr(key=camel, default=None)
finished_at: Optional[int] = attr(key=camel, default=None)
status: str = attr()
error_message: str = attr(key=camel)
_result: Optional[Dict[str, Any]] = attr(key="result")
error_message: str = attr(key=camel, default="")
_result: Optional[Dict[str, Any]] = attr(key="result", default=None)
description: Optional[str] = attr(default="")

def __init__( # pylint: disable=too-many-arguments
Expand Down
4 changes: 0 additions & 4 deletions tensorbay/client/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,8 @@ def _create_job(
response.update(
title=title,
arguments=arguments,
startedAt=None,
finishedAt=None,
status="QUEUING",
errorMessage="",
description=description,
result=None,
)
return response

Expand Down

0 comments on commit 7f4a2a5

Please sign in to comment.