Skip to content

Commit

Permalink
feat: Added payload id in python package (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngruelaneo committed Jul 19, 2024
2 parents a610b84 + 018bb93 commit db4a6ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/python/src/armonik/common/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class Task:

pod_hostname: Optional[str] = None

payload_id: Optional[str] = None

def refresh(self, task_client) -> None:
"""Refresh the fields of this task object by using the given task client
Expand Down Expand Up @@ -167,6 +169,7 @@ def refresh(self, task_client) -> None:
self.output = result.output

self.pod_hostname = result.pod_hostname
self.payload_id = result.payload_id
self.is_init = True

@classmethod
Expand Down Expand Up @@ -197,6 +200,7 @@ def from_message(cls, task_raw: TaskDetailed) -> "Task":
received_to_end_duration=duration_to_timedelta(task_raw.received_to_end_duration),
output=Output(error=(task_raw.output.error if not task_raw.output.success else None)),
pod_hostname=task_raw.pod_hostname,
payload_id=task_raw.payload_id,
)


Expand Down
1 change: 1 addition & 0 deletions packages/python/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class TestArmoniKTasks:
received_to_end_duration=datetime.timedelta(0),
output=Output(error=""),
pod_hostname="",
payload_id="",
)

def test_get_task(self):
Expand Down

0 comments on commit db4a6ff

Please sign in to comment.