From 1ba69b8abfb0798d8bd45a9390f1ab748a459a2d Mon Sep 17 00:00:00 2001 From: kenwoodjw Date: Fri, 5 Sep 2025 14:00:28 +0800 Subject: [PATCH] fix: child chunk API 404 due to UUID type comparison (#25234) Signed-off-by: kenwoodjw --- api/controllers/service_api/dataset/segment.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/controllers/service_api/dataset/segment.py b/api/controllers/service_api/dataset/segment.py index f5e2010ca..a22155b07 100644 --- a/api/controllers/service_api/dataset/segment.py +++ b/api/controllers/service_api/dataset/segment.py @@ -440,7 +440,7 @@ class DatasetChildChunkApi(DatasetApiResource): raise NotFound("Segment not found.") # validate segment belongs to the specified document - if segment.document_id != document_id: + if str(segment.document_id) != str(document_id): raise NotFound("Document not found.") # check child chunk @@ -451,7 +451,7 @@ class DatasetChildChunkApi(DatasetApiResource): raise NotFound("Child chunk not found.") # validate child chunk belongs to the specified segment - if child_chunk.segment_id != segment.id: + if str(child_chunk.segment_id) != str(segment.id): raise NotFound("Child chunk not found.") try: @@ -500,7 +500,7 @@ class DatasetChildChunkApi(DatasetApiResource): raise NotFound("Segment not found.") # validate segment belongs to the specified document - if segment.document_id != document_id: + if str(segment.document_id) != str(document_id): raise NotFound("Segment not found.") # get child chunk @@ -511,7 +511,7 @@ class DatasetChildChunkApi(DatasetApiResource): raise NotFound("Child chunk not found.") # validate child chunk belongs to the specified segment - if child_chunk.segment_id != segment.id: + if str(child_chunk.segment_id) != str(segment.id): raise NotFound("Child chunk not found.") # validate args