-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(related_issues): Minor code refactoring before feature work #69137
Conversation
Changes included: * Only return new data shape in endpoint * Add rate limit to endpoint * More explicit typing * Return list of group IDs instead of groups
response: dict[str, Any] = { | ||
related_set["type"]: [int(g.id) for g in related_set["data"]] | ||
for related_set in related_issues | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We won't be returning this data shape. The UI only uses the new shape (#68985).
@@ -13,8 +11,8 @@ | |||
} | |||
|
|||
|
|||
def find_related_issues(group: Group) -> list[dict[str, Any]]: | |||
related_issues = [] | |||
def find_related_issues(group: Group) -> list[dict[str, list[int] | str]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little tighter than Any
.
from sentry.models.group import Group | ||
from sentry.utils.query import RangeQuerySetWrapper | ||
|
||
|
||
def same_root_cause_analysis(group: Group) -> list[Group]: | ||
def same_root_cause_analysis(group: Group) -> list[int]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint is going to return the group IDs. This also makes typing a bit simpler in the module above.
Changes included: