Skip to content

ref(db): Add strong typing to postgres DatabaseWrapper#116088

Draft
vgrozdanic wants to merge 1 commit into
masterfrom
ref/strongly-type-postgres-base
Draft

ref(db): Add strong typing to postgres DatabaseWrapper#116088
vgrozdanic wants to merge 1 commit into
masterfrom
ref/strongly-type-postgres-base

Conversation

@vgrozdanic
Copy link
Copy Markdown
Member

Add concrete type annotations to CursorWrapper and DatabaseWrapper in
sentry.db.postgres.base, replacing untyped parameters with specific types
from psycopg2 and Django stubs.

Any is retained only where Django's _ExecuteWrapper protocol or the
__getattr__ proxy pattern requires it. SQL params use
Sequence[object] | Mapping[str, object] | None instead of Any.

Removes sentry.db.postgres.base from the mypy typing-issues ignore list
(the block that disables arg-type, assignment, attr-defined, etc.).

Add concrete type annotations to CursorWrapper and DatabaseWrapper in
sentry.db.postgres.base, replacing untyped parameters with specific
types from psycopg2 and Django stubs. Any is retained only where
Django's execute_wrapper protocol or the proxy pattern requires it.

Remove sentry.db.postgres.base from the mypy typing-issues ignore list.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant