Skip to content

Commit

Permalink
Merge pull request #23 from chezou/typehint2
Browse files Browse the repository at this point in the history
More type hint
  • Loading branch information
chezou committed May 31, 2023
2 parents 43fbcbf + 6b7b471 commit c8fd230
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 87 deletions.
9 changes: 6 additions & 3 deletions tdworkflow/attempt.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@ class Attempt(Resource):

def __post_init__(self) -> None:
self.id = int(self.id)
self.sessionTime = parse_iso8601(self.sessionTime) # type: ignore
if self.sessionTime and isinstance(self.sessionTime, str):
self.sessionTime = parse_iso8601(self.sessionTime)
if self.project and isinstance(self.project, dict):
self.project = Project(**self.project)
if self.workflow and isinstance(self.workflow, dict):
self.workflow = Workflow(**self.workflow)
self.done = bool(self.done)
self.success = bool(self.success)
self.cancelRequested = bool(self.cancelRequested)
self.createdAt = parse_iso8601(self.createdAt) # type: ignore
self.finishedAt = parse_iso8601(self.finishedAt) # type: ignore
if self.createdAt and isinstance(self.createdAt, str):
self.createdAt = parse_iso8601(self.createdAt)
if self.finishedAt and isinstance(self.finishedAt, str):
self.finishedAt = parse_iso8601(self.finishedAt)
self.status = self.status

@property
Expand Down
Loading

0 comments on commit c8fd230

Please sign in to comment.