Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added payload id in python package #534

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading