fix(data-process): 修正任务详情数据契约
This commit is contained in:
@@ -716,7 +716,9 @@ def task_detail(
|
||||
) -> dict[str, Any]:
|
||||
with api_errors():
|
||||
task = store.get_task(task_id)
|
||||
task["source_files"] = store.list_source_files(task_id)
|
||||
source_files = store.list_source_files(task_id)
|
||||
task["source_files"] = source_files
|
||||
task["source_file_count"] = len(source_files)
|
||||
return ok(task)
|
||||
|
||||
|
||||
|
||||
@@ -320,7 +320,12 @@ class DataProcessStore:
|
||||
'name', dataset.name,
|
||||
'type', dataset.type,
|
||||
'count', dataset.count,
|
||||
'dataset_split', dataset.metadata::jsonb->>'dataset_split'
|
||||
'dataset_split', CASE dataset.type
|
||||
WHEN 'train' THEN 'train'
|
||||
WHEN 'val' THEN 'validation'
|
||||
WHEN 'test' THEN 'test'
|
||||
ELSE NULL
|
||||
END
|
||||
) ORDER BY CASE dataset.type
|
||||
WHEN 'train' THEN 1 WHEN 'val' THEN 2 WHEN 'test' THEN 3 ELSE 4 END), '[]'::json)
|
||||
FROM datasets dataset
|
||||
@@ -1077,8 +1082,8 @@ class DataProcessStore:
|
||||
"""
|
||||
UPDATE data_process_tasks
|
||||
SET status='running', progress=30, failure_reason=NULL, started_at=%s,
|
||||
completed_at=NULL, filtered_count=0, duplicate_count=0, error_count=0,
|
||||
generation_run_id=%s, updated_at=%s
|
||||
completed_at=NULL, output_count=0, filtered_count=0,
|
||||
duplicate_count=0, error_count=0, generation_run_id=%s, updated_at=%s
|
||||
WHERE id=%s
|
||||
RETURNING *
|
||||
""",
|
||||
|
||||
Reference in New Issue
Block a user