Skip to content

Commit

Permalink
ref: use non-nullable .get() lookup instead of .first() (#75115)
Browse files Browse the repository at this point in the history
this would always crash on line 263 if it were nullable

<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry authored Jul 29, 2024
1 parent 0af2ecb commit 477d4ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sentry/api/endpoints/organization_events_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ def load_span_serialized_performance_issues(self, light: bool) -> None:
offender_span_ids = problem.evidence_data.get("offender_span_ids", [])
for group_id in self.event["occurrence_to_issue_id"][problem.id]:
if group_id not in memoized_groups:
memoized_groups[group_id] = Group.objects.filter(
memoized_groups[group_id] = Group.objects.get(
id=group_id, project=self.event["project.id"]
).first()
)
group = memoized_groups[group_id]
if event_span.get("span_id") in offender_span_ids:
start_timestamp = float(event_span["precise.start_ts"])
Expand Down

0 comments on commit 477d4ec

Please sign in to comment.