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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018jy52j9GRZ6XKa1Zt21LLj
This commit is contained in:
parent
23bc54f558
commit
8a10c3cacc
1 changed files with 3 additions and 1 deletions
4
crud.py
4
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
|
counter on the contract so the number survives a restart and stays
|
||||||
auditable — the rows that produced it are right there.
|
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 "
|
"SELECT COUNT(*) AS n FROM payroll.payouts "
|
||||||
"WHERE contract_id = :cid AND period_index = :idx AND status = :status",
|
"WHERE contract_id = :cid AND period_index = :idx AND status = :status",
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue