-
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] DF Analytics Regression results: Ensure error handling and table sort works correctly #49929
[ML] DF Analytics Regression results: Ensure error handling and table sort works correctly #49929
Conversation
Pinging @elastic/ml-ui (:ml) |
💚 Build Succeeded |
💚 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, just some minor suggestions
export const ExplorationTitle: React.SFC<{ jobId: string }> = ({ jobId }) => ( | ||
<EuiTitle size="xs"> | ||
<span> | ||
{i18n.translate('xpack.ml.dataframe.analytics.regressionExploration.jobIdTitle', { |
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.
FormattedMessage
? 👀
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.
Using FormattedMessage with EuiTitle
shows an Types of property 'children' are incompatible
TypeScript error. Since we've got some cleanup to do with replacing other .translate
with FormattedMessage
it might be best to update them in a single PR once we have that fix upstream. I can double check with the eui team to see what the timeline for that is.
if (e.message !== undefined) { | ||
setJobConfigErrorMessage(e.message); | ||
} else { | ||
setJobConfigErrorMessage(JSON.stringify(e)); | ||
} |
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.
I've seen this logic in a couple of places already, maybe we should create a function (or custom hook) to handle 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.
For now I think since this logic is fairly short and clear it's okay as is. 👍
helpText={i18n.translate( | ||
'xpack.ml.dataframe.analytics.regressionExploration.documentsShownHelpText', | ||
{ | ||
defaultMessage: 'Showing first 1000 documents', |
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.
Maybe you should parameterize the 1000
and pass in SEARCH_SIZE
from data_frame_analytics/common/analytics.ts
?
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.
Definitely should be - fixed in 90a54cc
Thanks 😄
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
I think in a follow up we should address issues around field types - setting the columnType
for each column using the field caps API (which explains why what look like numeric data sometimes get left aligned as strings), and disabling column sort when the type is text
💚 Build Succeeded |
… sort works correctly (elastic#49929) * add error handling for regression jobConfig fetch * fix sorting change causing blank table by removing table render timeout * Add label to table for number of docs obtained * parameterize searchSize in documents fetched text
Summary
This PR addresses all comments set as followups in #49667
including:
sorting issue fix (query then sort would empty the table)
Adds label to table for number of documents obtained
@walterra - I'd particularly like your thoughts on removing the
clearTable
workaround you originally added for EuiInMemoryTable to deal with issues with column sort. It appears to work as expected without the workaround - looks like Eui may have updated that component to fix the original issue as I can't reproduce it. I'll link a particular fix here if I can find one.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Documentation was added for features that require explanation or tutorials- [ ] 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