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(seer grouping): SeerSimilarIssueData.from_raw
improvements
#70668
Conversation
f1cf889
to
05955be
Compare
db22d42
to
3d4e03a
Compare
src/sentry/seer/utils.py
Outdated
required_keys = {"stacktrace_distance", "message_distance", "should_group"} | ||
optional_keys = {"parent_hash", "parent_group_id"} | ||
expected_keys = {*required_keys, *optional_keys} |
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.
nit: since these are constants, you could pull them out of the function to be on the class / a constant at top of file.
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.
Good idea. Done.
3d4e03a
to
33cd705
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #70668 +/- ##
=======================================
Coverage 80.02% 80.03%
=======================================
Files 6508 6508
Lines 291198 291270 +72
Branches 50202 50200 -2
=======================================
+ Hits 233028 233104 +76
+ Misses 57736 57732 -4
Partials 434 434
|
This makes a number of improvements to the
from_raw1 factory method in the
SeerSimilarIssueData` dataclass, all related to the fact that the data being fed to it comes straight from the JSON returned by Seer and so we can't actually guarantee what's in it.Included changes:
raw_similar_issue_data
parameter, fromRawSeerSimilarIssueData
(implying we know exactly what's in it) toMapping[str, Any]
(acknowledging that we don't).SeerSimilarIssueData
constructor from crashing with an 'unknown keyword argument' error in the case of unexpected data.