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

[ML] DF Analytics Regression results: Ensure error handling and table sort works correctly #49929

Merged

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Oct 31, 2019

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

image

  • Error handling for initial jobConfig loading in results view. If the jobConfig fails to load this error message is shown instead of an infinite loading screen.

Screen Shot 2019-10-31 at 3 37 50 PM

  • small code improvements

@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 strikethroughs to remove checklist items you don't feel are applicable to this PR.

For 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

@alvarezmelissa87 alvarezmelissa87 added :ml v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Data Frame Analytics ML data frame analytics features v7.6.0 labels Oct 31, 2019
@alvarezmelissa87 alvarezmelissa87 requested review from a team as code owners October 31, 2019 21:12
@alvarezmelissa87 alvarezmelissa87 self-assigned this Oct 31, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@darnautov darnautov left a 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', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FormattedMessage? 👀

Copy link
Contributor Author

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.

Comment on lines +62 to +66
if (e.message !== undefined) {
setJobConfigErrorMessage(e.message);
} else {
setJobConfigErrorMessage(JSON.stringify(e));
}
Copy link
Contributor

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?

Copy link
Contributor Author

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',
Copy link
Contributor

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 ?

Copy link
Contributor Author

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 😄

Copy link
Contributor

@peteharverson peteharverson left a 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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@alvarezmelissa87 alvarezmelissa87 merged commit 568b8d3 into elastic:master Nov 1, 2019
@alvarezmelissa87 alvarezmelissa87 deleted the ml-regression-ui-followups branch November 1, 2019 16:13
alvarezmelissa87 added a commit to alvarezmelissa87/kibana that referenced this pull request Nov 1, 2019
… 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
alvarezmelissa87 added a commit that referenced this pull request Nov 1, 2019
… sort works correctly (#49929) (#49954)

* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Frame Analytics ML data frame analytics features :ml release_note:skip Skip the PR/issue when compiling release notes v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants