Skip to content

Commit 45f6b4d

Browse files
authored
ref: Use eventstore for group hashes endpoint (#16286)
SnubaEvent is deprecated
1 parent 41cd459 commit 45f6b4d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/sentry/api/endpoints/group_hashes.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
from rest_framework.response import Response
66

7+
from sentry import eventstore
78
from sentry.api.base import DocSection
89
from sentry.api.bases import GroupEndpoint
910
from sentry.api.paginator import GenericOffsetPaginator
1011
from sentry.api.serializers import EventSerializer, serialize
11-
from sentry.models import Group, GroupHash, SnubaEvent
12+
from sentry.models import Group, GroupHash
1213
from sentry.tasks.unmerge import unmerge
1314
from sentry.utils.apidocs import scenario, attach_scenarios
1415
from sentry.utils.snuba import raw_query
@@ -79,14 +80,9 @@ def __handle_results(self, project_id, group_id, user, results):
7980
return [self.__handle_result(user, project_id, group_id, result) for result in results]
8081

8182
def __handle_result(self, user, project_id, group_id, result):
82-
event = {
83-
"timestamp": result["latest_event_timestamp"],
84-
"event_id": result["event_id"],
85-
"group_id": group_id,
86-
"project_id": project_id,
87-
}
83+
event = eventstore.get_event_by_id(project_id, result["event_id"])
8884

8985
return {
9086
"id": result["primary_hash"],
91-
"latestEvent": serialize(SnubaEvent(event), user, EventSerializer()),
87+
"latestEvent": serialize(event, user, EventSerializer()),
9288
}

0 commit comments

Comments
 (0)