Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: make top_values hashable #83262

Merged
merged 1 commit into from
Jan 13, 2025
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: 4 additions & 4 deletions src/sentry/tagstore/snuba/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def __get_tag_key_and_top_values(
key_ctor = functools.partial(GroupTagKey, group_id=group.id)
value_ctor = functools.partial(GroupTagValue, group_id=group.id)

top_values = [
top_values = tuple(
value_ctor(
key=key,
value=value,
Expand All @@ -172,7 +172,7 @@ def __get_tag_key_and_top_values(
last_seen=parse_datetime(data["last_seen"]),
)
for value, data in result.items()
]
)

return key_ctor(
key=key,
Expand Down Expand Up @@ -661,7 +661,7 @@ def get_group_tag_keys_and_top_values(
for keyobj in keys_with_counts:
key = keyobj.key
values = values_by_key.get(key, dict())
keyobj.top_values = [
keyobj.top_values = tuple(
GroupTagValue(
group_id=group.id,
key=keyobj.key,
Expand All @@ -671,7 +671,7 @@ def get_group_tag_keys_and_top_values(
last_seen=parse_datetime(data["last_seen"]),
)
for value, data in values.items()
]
)

return keys_with_counts

Expand Down
Loading