diff --git a/backend/app/services/approval_task_links.py b/backend/app/services/approval_task_links.py index 595cabd3..6d513387 100644 --- a/backend/app/services/approval_task_links.py +++ b/backend/app/services/approval_task_links.py @@ -3,7 +3,7 @@ from __future__ import annotations from collections.abc import Iterable, Sequence -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, cast from uuid import UUID from sqlalchemy import case, delete, exists, func @@ -266,8 +266,9 @@ async def task_counts_for_board( for legacy_task_id, total, pending in list(await session.exec(legacy_statement)): if legacy_task_id is None: continue - previous = counts.get(legacy_task_id, (0, 0)) - counts[legacy_task_id] = ( + task_uuid = cast(UUID, legacy_task_id) + previous = counts.get(task_uuid, (0, 0)) + counts[task_uuid] = ( previous[0] + int(total or 0), previous[1] + int(pending or 0), )