From 8a10c3caccde697b942ef017177c562434b73626 Mon Sep 17 00:00:00 2001 From: Padreug Date: Mon, 31 Aug 2026 13:56:45 +0200 Subject: [PATCH] chore: annotate the aggregate row so mypy passes `fetchone` without a model leaves its TModel unbound, so the COUNT(*) row needs an explicit type. Completes the black + ruff + mypy pipeline the Makefile declares. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_018jy52j9GRZ6XKa1Zt21LLj --- crud.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crud.py b/crud.py index 8029f26..80af91f 100644 --- a/crud.py +++ b/crud.py @@ -148,7 +148,9 @@ async def count_period_failures(contract_id: str, period_index: int) -> int: counter on the contract so the number survives a restart and stays auditable — the rows that produced it are right there. """ - row = await db.fetchone( + # No model: fetchone's TModel is unbound for a bare aggregate, so the + # row comes back as a plain mapping and needs its own annotation. + row: dict | None = await db.fetchone( "SELECT COUNT(*) AS n FROM payroll.payouts " "WHERE contract_id = :cid AND period_index = :idx AND status = :status", {