Skip to content

[DRAFT] Type-check metrics query_builder and remove module ignore#118624

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

[DRAFT] Type-check metrics query_builder and remove module ignore#118624
cursor[bot] wants to merge 2 commits into
masterfrom
cursor/untyped-module-cleanup-5ba3

Conversation

@cursor

@cursor cursor Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove sentry.snuba.metrics.query_builder from the mypy module-ignores override list in pyproject.toml
  • fix all mypy errors in src/sentry/snuba/metrics/query_builder.py
  • tighten type narrowing for group-by/order-by handling and keep runtime metric params intact while satisfying typing

Testing

  • source .venv/bin/activate && python -m tools.mypy_helpers.mypy_without_ignores src/sentry/snuba/metrics/query_builder.py
  • source .venv/bin/activate && .venv/bin/pytest -n3 -svv --reuse-db tests/sentry/snuba/metrics/test_query_builder.py
  • source .venv/bin/activate && .venv/bin/prek run -q
  • make test-selective (fails in this environment because gcloud is unavailable)

cc @armenzg

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 June 28, 2026 12:06
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 Jun 28, 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