diff --git a/packages/python/src/armonik/common/objects.py b/packages/python/src/armonik/common/objects.py index ead6d712..4bac86ce 100644 --- a/packages/python/src/armonik/common/objects.py +++ b/packages/python/src/armonik/common/objects.py @@ -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 @@ -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 @@ -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, ) diff --git a/packages/python/tests/test_tasks.py b/packages/python/tests/test_tasks.py index cbfbe440..8ed993c9 100644 --- a/packages/python/tests/test_tasks.py +++ b/packages/python/tests/test_tasks.py @@ -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):