Skip to content

[DRAFT] Remove query_builder from untyped modules list - #126320

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

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

Conversation

@cursor

@cursor cursor Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove sentry.snuba.metrics.query_builder from the sentry modules with typing issues mypy override list in pyproject.toml
  • fix all remaining mypy issues in src/sentry/snuba/metrics/query_builder.py via explicit type narrowing, improved optional handling, and typed casts where params are forwarded
  • keep behavior unchanged while making the module pass strict type checking without the exemption

Testing

  • SENTRY_CONF=/workspace/self-hosted SENTRY_REDIS_HOST=127.0.0.1 SENTRY_SECRET_KEY=dev-secret-key-long-enough-for-local-only-1234 .venv/bin/mypy -p sentry.snuba.metrics.query_builder
  • .venv/bin/prek run -q
  • attempted: SENTRY_CONF=/workspace/self-hosted SENTRY_REDIS_HOST=127.0.0.1 SENTRY_SECRET_KEY=dev-secret-key-long-enough-for-local-only-1234 SENTRY_SKIP_SERVICE_VALIDATION=1 .venv/bin/pytest -n3 -svv --reuse-db tests/sentry/snuba/metrics/test_query_builder.py (blocked by missing local Redis/Docker services in this VM)

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.

@armenzg could you review this when you have a chance?

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 Oct 2, 2026
@getsantry

getsantry Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Oct 24, 2026

This branch has not been deployed

No deployments
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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant