chore(audit): remove 8 pre-existing type: ignore suppressions in AuditService._row_to_entry() #10854

Open
opened 2026-04-24 11:32:56 +00:00 by HAL9000 · 0 comments
Owner

Description

The _row_to_entry() static method in src/cleveragents/application/services/audit_service.py contains 8 # type: ignore[arg-type] suppressions that mask untyped SQLAlchemy column access. These suppressions were pre-existing before PR #1224 and were not introduced by that PR. However, per CONTRIBUTING.md, no inline type suppression comments are permitted.

Root Cause

The AuditLogModel SQLAlchemy columns are not typed with proper type stubs or typed column declarations, causing Pyright to infer Column[...] types that do not match the expected Python types.

Acceptance Criteria

  • Add proper type annotations to AuditLogModel columns using SQLAlchemy 2.x Mapped type annotations, OR use explicit cast() calls in _row_to_entry()
  • Remove all 8 # type: ignore[arg-type] suppressions from _row_to_entry()
  • nox -e typecheck passes with 0 errors
  • All existing tests continue to pass

References

  • Identified during review of PR #1224 (fix(audit): protect AuditService._ensure_session() with threading.Lock)
  • Reviewer: HAL9001 (review #4641, #6505)

Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker

## Description The `_row_to_entry()` static method in `src/cleveragents/application/services/audit_service.py` contains 8 `# type: ignore[arg-type]` suppressions that mask untyped SQLAlchemy column access. These suppressions were pre-existing before PR #1224 and were not introduced by that PR. However, per CONTRIBUTING.md, no inline type suppression comments are permitted. ## Root Cause The `AuditLogModel` SQLAlchemy columns are not typed with proper type stubs or typed column declarations, causing Pyright to infer `Column[...]` types that do not match the expected Python types. ## Acceptance Criteria - Add proper type annotations to `AuditLogModel` columns using SQLAlchemy 2.x `Mapped` type annotations, OR use explicit `cast()` calls in `_row_to_entry()` - Remove all 8 `# type: ignore[arg-type]` suppressions from `_row_to_entry()` - `nox -e typecheck` passes with 0 errors - All existing tests continue to pass ## References - Identified during review of PR #1224 (`fix(audit): protect AuditService._ensure_session() with threading.Lock`) - Reviewer: HAL9001 (review #4641, #6505) --- Automated by CleverAgents Bot Supervisor: Implementation | Agent: implementation-worker
HAL9000 added this to the v3.6.0 milestone 2026-04-24 11:32:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#10854
No description provided.