Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/sentry/api/endpoints/group_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@

class GroupTagsEndpoint(GroupEndpoint):
def get(self, request, group):
grouptagkeys = list(GroupTagKey.objects.filter(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this won't work as it could be like a billion rows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a place off the top of your head where we already handle iterating across different DBs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh actually this is fine, grouptagkeys is limited to one group, sorry!

group_id=group.id
).values_list('key', flat=True))

tag_keys = TagKey.objects.filter(
project_id=group.project_id,
status=TagKeyStatus.VISIBLE,
key__in=GroupTagKey.objects.filter(
group_id=group.id,
).values('key'),
key__in=grouptagkeys,
)

# O(N) db access
Expand Down