Skip to content

Draft: Type sentry.snuba.metrics.query_builder and remove mypy ignore#118620

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

Draft: Type sentry.snuba.metrics.query_builder and remove mypy ignore#118620
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/untyped-module-cleanup-3f70

Conversation

@cursor

@cursor cursor Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • removed sentry.snuba.metrics.query_builder from the tool.mypy.overrides module ignore list in pyproject.toml
  • fixed typing issues in src/sentry/snuba/metrics/query_builder.py by tightening/narrowing union types and adding explicit typed helpers for params and metric keys
  • kept behavior intact while making the module pass mypy without disable-error-code overrides

Testing

  • source .venv/bin/activate && .venv/bin/python -m tools.mypy_helpers.mypy_without_ignores src/sentry/snuba/metrics/query_builder.py
  • source .venv/bin/activate && .venv/bin/python -m mypy src/sentry/snuba/metrics/query_builder.py
  • source .venv/bin/activate && .venv/bin/prek run -q
  • source .venv/bin/activate && .venv/bin/pytest -n3 -svv --reuse-db tests/sentry/snuba/metrics/test_query_builder.py ❌ (environment: local Redis/Postgres unavailable)
  • source .venv/bin/activate && SENTRY_SKIP_SERVICE_VALIDATION=1 .venv/bin/pytest -n3 -svv --reuse-db tests/sentry/snuba/metrics/test_query_builder.py ❌ (environment: local Redis/Postgres unavailable)
  • source .venv/bin/activate && SENTRY_SKIP_SERVICE_VALIDATION=1 make test-selective ❌ (gcloud not installed in this environment)

Review

@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 

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 27, 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