mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-23 08:56:42 +08:00
fix: return full record in get_ingestion_log (#16120)
### What problem does this PR solve? The `get_ingestion_log` endpoint (both Python `dataset_api_service.get_ingestion_log` and Go `DatasetService.GetIngestionLog`) was returning only the **dataset-level** field set, which omits critical fields such as `dsl`, `document_id`, `parser_id`, `document_name`, `pipeline_id`, etc. This caused the front-end **dataflow-result page** to be unable to render the pipeline timeline and chunks when viewing a single ingestion log, regardless of whether the log was a dataset-level operation (graph/raptor/mindmap) or a per-file parse. ### Background `PipelineOperationLogService` provides two field sets: | Method | Fields | |---|---| | `get_dataset_logs_fields` | Minimal set (progress, status, timestamps, etc.) | | `get_file_logs_fields` | Superset — includes `document_id`, `dsl`, `parser_id`, `document_name`, `pipeline_id`, … | When listing logs, the API correctly distinguishes dataset-level vs file-level logs and uses the appropriate converter. However, when **fetching a single log by ID**, both the Python and Go implementations were hardcoded to the dataset-level set, dropping the extra fields that the front-end needs.
This commit is contained in:
@@ -781,7 +781,11 @@ def get_ingestion_log(dataset_id: str, tenant_id: str, log_id: str):
|
||||
|
||||
from api.db.services.pipeline_operation_log_service import PipelineOperationLogService
|
||||
|
||||
fields = PipelineOperationLogService.get_dataset_logs_fields()
|
||||
# Return the full record (including `dsl`) so the front-end dataflow-result
|
||||
# page can render the pipeline timeline and chunks. The file-level field set
|
||||
# is a superset of the dataset-level fields, so it is valid for both
|
||||
# dataset-level (graph/raptor/mindmap) and per-file logs.
|
||||
fields = PipelineOperationLogService.get_file_logs_fields()
|
||||
log = PipelineOperationLogService.model.select(*fields).where((PipelineOperationLogService.model.id == log_id) & (PipelineOperationLogService.model.kb_id == dataset_id)).first()
|
||||
if not log:
|
||||
return False, "Log not found"
|
||||
|
||||
Reference in New Issue
Block a user