Skip to content

[DRAFT] Remove query_builder from the mypy typing-issues list - #124239

Draft
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/untyped-module-cleanup-bd3f
Draft

[DRAFT] Remove query_builder from the mypy typing-issues list#124239
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/untyped-module-cleanup-bd3f

Conversation

@cursor

@cursor cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove sentry.snuba.metrics.query_builder from the tool.mypy.overrides typing-issues allowlist in pyproject.toml.
  • Fix strict typing issues in src/sentry/snuba/metrics/query_builder.py by adding explicit narrowing and typed parameter handling where mypy previously failed.
  • Keep runtime behavior intact while satisfying strict checks for the module.

Testing

  • SENTRY_CONF=/workspace/self-hosted SENTRY_REDIS_HOST=localhost SENTRY_SECRET_KEY=abcdefghijklmnopqrstuvwxyz012345 PYTHONPATH=src python -m tools.mypy_helpers.mypy_without_ignores src/sentry/snuba/metrics/query_builder.py
  • SENTRY_CONF=/workspace/self-hosted SENTRY_REDIS_HOST=localhost SENTRY_SECRET_KEY=abcdefghijklmnopqrstuvwxyz012345 PYTHONPATH=src mypy --config-file pyproject.toml src/sentry/snuba/metrics/query_builder.py
  • SENTRY_CONF=/workspace/self-hosted SENTRY_REDIS_HOST=localhost SENTRY_SECRET_KEY=abcdefghijklmnopqrstuvwxyz012345 PYTHONPATH=src .venv/bin/prek run -q

@armenzg please review this draft PR.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Open in Web View Automation 

Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 12, 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