Skip to content

[Draft] Remove query_builder from mypy typing-issues list - #118904

Draft
cursor[bot] wants to merge 2 commits into
masterfrom
cursor/untyped-module-cleanup-073d
Draft

[Draft] Remove query_builder from mypy typing-issues list#118904
cursor[bot] wants to merge 2 commits into
masterfrom
cursor/untyped-module-cleanup-073d

Conversation

@cursor

@cursor cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove sentry.snuba.metrics.query_builder from the sentry modules with typing issues mypy override block in pyproject.toml.
  • Fix all mypy issues in src/sentry/snuba/metrics/query_builder.py so it type-checks without the temporary error-code disables.
  • Improve type narrowing and parameter typing flow in SnubaQueryBuilder and SnubaResultConverter to satisfy strict typing.

Testing

  • PATH="$PWD/.venv/bin:$PATH" .venv/bin/mypy src/sentry/snuba/metrics/query_builder.py
  • PATH="$PWD/.venv/bin:$PATH" .venv/bin/python -m tools.mypy_helpers.mypy_without_ignores src/sentry/snuba/metrics/query_builder.py
  • PATH="$PWD/.venv/bin:$PATH" .venv/bin/prek run -q --files src/sentry/snuba/metrics/query_builder.py pyproject.toml

Environment limits encountered

  • make test-selective fails in this VM because gcloud is unavailable.
  • pytest tests/sentry/snuba/metrics/test_query_builder.py could not run to completion in this VM due missing local Postgres/Redis (and devservices unable to start because Docker daemon is unavailable here).

@armenzg could you 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 

cursoragent and others added 2 commits July 2, 2026 12:07
Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
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 Jul 2, 2026
@getsantry

getsantry Bot commented Jul 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 Jul 24, 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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant