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

Fix for task id as valid UUID #3744

Merged
merged 18 commits into from
Nov 27, 2024
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion rocky/rocky/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,15 @@ def list_tasks(self, **kwargs) -> PaginatedTasksResponse:
filter_key = "filters"
params = {k: v for k, v in kwargs.items() if v is not None if k != filter_key} # filter Nones from kwargs
endpoint = "/tasks"
res = self._client.post(endpoint, params=params, json=kwargs.get(filter_key, None))
res = self._client.post(endpoint, params=params, json=kwargs.get(filter_key))
underdarknl marked this conversation as resolved.
Show resolved Hide resolved
return PaginatedTasksResponse.model_validate_json(res.content)
except ValidationError:
raise SchedulerValidationError(extra_message=_("Task list: "))
except ConnectError:
raise SchedulerConnectError(extra_message=_("Task list: "))

def get_task_details(self, task_id: str) -> Task:
task_id = str(uuid.UUID(task_id))
return Task.model_validate_json(self._get(f"/tasks/{task_id}", "content"))

def push_task(self, item: Task) -> None:
Expand Down