From 477d4ec4878a939d24276e894db011571f99e471 Mon Sep 17 00:00:00 2001 From: anthony sottile <103459774+asottile-sentry@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:20:26 -0400 Subject: [PATCH] ref: use non-nullable .get() lookup instead of .first() (#75115) this would always crash on line 263 if it were nullable --- src/sentry/api/endpoints/organization_events_trace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sentry/api/endpoints/organization_events_trace.py b/src/sentry/api/endpoints/organization_events_trace.py index f482cd406db7b1..583d49fb17dafb 100644 --- a/src/sentry/api/endpoints/organization_events_trace.py +++ b/src/sentry/api/endpoints/organization_events_trace.py @@ -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"])