Skip to content

chore(typing): Remove sentry.search.events.datasets.filter_aliases from mypy ignore list#116937

Merged
shashjar merged 3 commits into
masterfrom
shashjar/type-sentry-search-events-datasets-filter-aliases
Jun 8, 2026
Merged

chore(typing): Remove sentry.search.events.datasets.filter_aliases from mypy ignore list#116937
shashjar merged 3 commits into
masterfrom
shashjar/type-sentry-search-events-datasets-filter-aliases

Conversation

@shashjar

@shashjar shashjar commented Jun 4, 2026

Copy link
Copy Markdown
Member

Resolves ENG-6454.

Fixes typing in sentry.search.events.datasets.filter_aliases and removes it from the mypy ignore list.

Most errors stem from SearchValue.raw_value having a broad union type (str | float | datetime | Sequence[float] | Sequence[str]) while these filter functions always receive strings. Narrowed the types with validation at each point of use.

Changes:

  • Narrow raw_value to str via isinstance in span_is_segment_converter, semver_filter_converter, semver_package_filter_converter, semver_build_filter_converter, and span_module_filter_converter
  • Narrow raw_value to str | list in lowercase_search and span_status_filter_converter to handle each raw_value shape
  • Filter None from builder.params.environments before passing to parse_release
  • Pass environment names (list[str]) to filter_by_stage instead of Environment objects, matching its Sequence[str | int] | None signature

@linear-code

linear-code Bot commented Jun 4, 2026

Copy link
Copy Markdown

ENG-6454

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 4, 2026
@shashjar shashjar requested a review from a team June 5, 2026 18:47
@shashjar shashjar marked this pull request as ready for review June 5, 2026 18:47
@shashjar shashjar requested review from a team as code owners June 5, 2026 18:47
@shashjar shashjar removed request for a team June 5, 2026 18:47

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ec3f9c5. Configure here.

Comment thread src/sentry/search/events/datasets/filter_aliases.py
@shashjar shashjar merged commit d9115b9 into master Jun 8, 2026
88 checks passed
@shashjar shashjar deleted the shashjar/type-sentry-search-events-datasets-filter-aliases branch June 8, 2026 16:52
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.

2 participants