mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-11-01 05:06:58 +08:00
fix(types): annotate CursorResult.rowcount for mypy in delete_orphans
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs
This commit is contained in:
@@ -154,7 +154,8 @@ class TorrentDatabase:
|
||||
delete(Torrent).where(Torrent.bangumi_id.is_(None)) # type: ignore[union-attr]
|
||||
)
|
||||
await self.session.commit()
|
||||
count = result.rowcount
|
||||
# execute(delete()) 返回 CursorResult,mypy 只能推断出基类 Result[Any]
|
||||
count = result.rowcount # type: ignore[attr-defined]
|
||||
if count > 0:
|
||||
logger.debug("Deleted %s orphan torrents.", count)
|
||||
return count
|
||||
|
||||
Reference in New Issue
Block a user