Skip to content

Commit

Permalink
typing(api): Type check src/sentry/api/endpoints/project_group_index.…
Browse files Browse the repository at this point in the history
…py (#76667)
  • Loading branch information
armenzg authored Aug 28, 2024
1 parent 7225d3a commit e4ff0e6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ module = [
"sentry.api.endpoints.organization_sessions",
"sentry.api.endpoints.organization_stats",
"sentry.api.endpoints.organization_teams",
"sentry.api.endpoints.project_group_index",
"sentry.api.endpoints.project_index",
"sentry.api.endpoints.project_ownership",
"sentry.api.endpoints.project_release_files",
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/project_group_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get(self, request: Request, project) -> Response:
matching_event = eventstore.backend.get_event_by_id(project.id, event_id)
elif matching_group is None:
matching_group = get_by_short_id(
project.organization_id, request.GET.get("shortIdLookup"), query
project.organization_id, request.GET.get("shortIdLookup", "0"), query
)
if matching_group is not None and matching_group.project_id != project.id:
matching_group = None
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/api/helpers/group_index/index.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable, Mapping, MutableMapping, Sequence
from datetime import datetime
from typing import Any, Optional
from typing import Any

import sentry_sdk
from django.contrib.auth.models import AnonymousUser
Expand Down Expand Up @@ -184,7 +184,7 @@ def get_by_short_id(
organization_id: int,
is_short_id_lookup: str,
query: str,
) -> Optional["Group"]:
) -> Group | None:
if is_short_id_lookup == "1" and looks_like_short_id(query):
try:
return Group.objects.by_qualified_short_id(organization_id, query)
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/helpers/group_index/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def get_current_release_version_of_group(

def update_groups(
request: Request,
group_ids: Sequence[int] | None,
group_ids: Sequence[int | str] | None,
projects: Sequence[Project],
organization_id: int,
search_fn: SearchFunction | None,
Expand Down

0 comments on commit e4ff0e6

Please sign in to comment.