From 5318ee964136e2e085ffc8b36b812d8e2aa737c7 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sat, 31 Jan 2026 14:39:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(annotation):=20=E4=BF=AE=E5=A4=8D=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=9C=8D=E5=8A=A1=E4=B8=AD=E7=9A=84=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了重复的else分支代码块 - 修复了分段索引键不存在时的数据处理流程 - 简化了列表类型分段的处理逻辑 - 消除了重复的数据添加操作 --- .../datamate-python/app/module/annotation/service/export.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/runtime/datamate-python/app/module/annotation/service/export.py b/runtime/datamate-python/app/module/annotation/service/export.py index c2a4aec..dde4553 100644 --- a/runtime/datamate-python/app/module/annotation/service/export.py +++ b/runtime/datamate-python/app/module/annotation/service/export.py @@ -265,8 +265,6 @@ class AnnotationExportService: if SEGMENT_INDEX_KEY not in normalized and SEGMENT_INDEX_FALLBACK_KEY not in normalized: normalized[SEGMENT_INDEX_KEY] = int(key) if str(key).isdigit() else key results.append(normalized) - else: - results.append({"value": item, SEGMENT_INDEX_KEY: key}) elif isinstance(segments, list): for idx, segment in enumerate(segments): if not isinstance(segment, dict): @@ -281,8 +279,6 @@ class AnnotationExportService: if SEGMENT_INDEX_KEY not in normalized and SEGMENT_INDEX_FALLBACK_KEY not in normalized: normalized[SEGMENT_INDEX_KEY] = segment_index results.append(normalized) - else: - results.append({"value": item, SEGMENT_INDEX_KEY: segment_index}) return results result = annotation.get(SEGMENT_RESULT_KEY) return result if isinstance(result, list) else []