We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d61ba00 commit 888e10fCopy full SHA for 888e10f
packages/models-library/src/models_library/api_schemas_long_running_tasks/tasks.py
@@ -28,13 +28,13 @@ class TaskBase(BaseModel):
28
29
@field_validator("task_name", mode="before")
30
@classmethod
31
- def populate_task_name(cls, task_name: str, info):
+ def populate_task_name_if_not_provided(cls, task_name: str, info):
32
# attempt to extract the task name from the task_id
33
# if this is coming form a long_running_task
34
- task_id = info.data.get("task_id")
35
- if task_id:
+ task_id = info.data["task_id"]
+ if task_id and task_name == "":
36
parts = task_id.split(".")
37
- if len(parts) >= 2:
+ if len(parts) > 1:
38
task_name = urllib.parse.unquote(parts[1])
39
40
return task_name
0 commit comments