fix(mypy): cast legacy approval task_id after None-check

This commit is contained in:
Abhimanyu Saharan
2026-02-12 13:47:39 +00:00
committed by Abhimanyu Saharan
parent 32e8855404
commit a212265573

View File

@@ -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),
)