Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
kddubey committed Feb 14, 2025
1 parent 6f28b9c commit f415a75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/sentry/api/endpoints/seer_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def _get_issues_for_file(
def _add_event_details(
projects: list[Project],
issues_result_set: list[dict[str, Any]],
event_timestamp_start: datetime,
event_timestamp_end: datetime,
event_timestamp_start: datetime | None,
event_timestamp_end: datetime | None,
) -> list[dict[str, Any]]:
"""
Bulk-fetch the events corresponding to the issues, and bulk-serialize them.
Expand Down
24 changes: 15 additions & 9 deletions tests/sentry/api/endpoints/test_seer_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,18 @@ def setUp(self):
)

groups: list[Group] = list(Group.objects.all())
issues_result_set = [
{
"group_id": group.id,
"event_id": group.get_latest_event().event_id,
"title": f"title_{i}",
"function_name": f"function_{i}",
}
for i, group in enumerate(groups)
]
issues_result_set = []
for group_num, group in enumerate(groups):
event = group.get_latest_event()
assert event is not None
issues_result_set.append(
{
"group_id": group.id,
"event_id": event.event_id,
"title": f"title_{group_num}",
"function_name": f"function_{group_num}",
}
)
self.issues_with_event_details = _add_event_details(
projects=[self.project],
issues_result_set=issues_result_set,
Expand Down Expand Up @@ -190,6 +193,9 @@ def test_get_issues_related_to_file_patches(
filename: self.issues_with_event_details for filename in filename_to_patch
}

assert self.gh_repo.provider is not None
assert self.gh_repo.external_id is not None

filename_to_issues = get_issues_related_to_file_patches(
organization_id=self.organization.id,
provider=self.gh_repo.provider,
Expand Down

0 comments on commit f415a75

Please sign in to comment.