-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Fixing overview page max anomaly score #48110
[ML] Fixing overview page max anomaly score #48110
Conversation
💚 Build Succeeded |
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.
LGTM ⚡️Nice find - thank you! 🙌
Pinging @elastic/ml-ui (:ml) |
scores[groupId] = resultsIndex !== undefined && results[resultsIndex]; | ||
tempGroups[groupId].max_anomaly_score = resultsIndex !== undefined && results[resultsIndex]; | ||
const { maxScore } = resultsIndex !== undefined && results[resultsIndex]; | ||
scores[groupId].maxScore = maxScore || undefined; |
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.
@alvarezmelissa87 is this line needed?
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 undefined
is just used as a check in the displaying component so we know when to show the warning icon - we do an explicit check for undefined
to see if the maxScore was not properly loaded.
If on line 106 the maxScore
is already undefined
when not found then I don't think we need it.
I'd lean toward keeping it to ensure we're always getting undefined when maxScore doesn't get set correctly. 🤔
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.
but as far as i can tell tempGroups
on the line below is used for that check.
it doesn't look like scores
is used after this loop over its 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.
from my tests this line isn't needed, so i'm removing it.
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.
LGTM
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.
LGTM ⚡️ Good find - thank you! 🙏
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.
LGTM
💚 Build Succeeded |
* [ML] Fixing overview page max anomaly score * removing unnecessary copy of maxScore
Fixes max anomaly scores on overview page if, for whatever reason, the scores can't be loaded for a group.
Changes the endpoint to return JSON rather than a number.
before:
After:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] Unit or functional tests were updated or added to match the most common scenarios- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately