From ea6765ea0f01378dd70e482308c1a43317b016a5 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 20 Jan 2026 00:30:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(annotation):=20=E4=BF=AE=E6=94=B9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E6=96=87=E4=BB=B6=E7=8A=B6=E6=80=81=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将文件状态查询从仅统计 ACTIVE 状态扩展为 ACTIVE 和 COMPLETED 状态 - 使用 in_ 操作符替代等于操作符以支持多状态查询 - 保持原有数据集标注计数功能不变 --- .../datamate-python/app/module/annotation/service/mapping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/datamate-python/app/module/annotation/service/mapping.py b/runtime/datamate-python/app/module/annotation/service/mapping.py index 5884ad6..cad7362 100644 --- a/runtime/datamate-python/app/module/annotation/service/mapping.py +++ b/runtime/datamate-python/app/module/annotation/service/mapping.py @@ -49,11 +49,11 @@ class DatasetMappingService: Returns: (total_count, annotated_count) 元组 """ - # 获取数据集总数据量(只统计 ACTIVE 状态的文件) + # 获取数据集总数据量(统计 ACTIVE 和 COMPLETED 状态的文件) total_result = await self.db.execute( select(func.count()).select_from(DatasetFiles).where( DatasetFiles.dataset_id == dataset_id, - DatasetFiles.status == "ACTIVE", + DatasetFiles.status.in_(["ACTIVE", "COMPLETED"]), ) ) total_count = int(total_result.scalar() or 0)