-
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] Anomaly Detection: Fix validation error when no data in index. #86114
[ML] Anomaly Detection: Fix validation error when no data in index. #86114
Conversation
Pinging @elastic/ml-ui (:ml) |
c7f35f9
to
1d06c6a
Compare
@peteharverson Good catch. I implemented the solution we discussed in 431710e. Also updated the PR description. |
if (typeof job === 'object') { | ||
// Run job validation only if a job config has been passed on and the duration makes sense to run it. | ||
// Otherwise we skip the call and display a generic warning, but let the user move on to the next wizard step. | ||
if (typeof job === 'object' && duration.start !== null && duration.end !== null) { |
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, this whole condition could be wrapped in an outer if (typeof job === 'object') {
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.
Fixed in b366241. Just became aware that this is still plain JavaScript so I added another check against typeof duration === 'object')
too.
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.
Tested and LGTM.
@jgowdyelastic do you know if there's an easy way to get rid of the 0
that appears in the last step of the multi metric wizard in place of the usual chart(s) when there is no data:
💚 Build SucceededMetrics [docs]Async chunks
Distributable file count
History
To update your PR or re-run it, just comment with: |
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
…lastic#86114) For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard. This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
…lastic#86114) For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard. This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
…86114) (#86349) For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard. This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
…86114) (#86348) For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard. This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
Summary
Part of #78784
For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard.
This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
This also picks up work done in #78931 to allow users to create jobs when the source index doesn't include data yet. Previously, the call to job validation would fail and the user cannot continue:
Now we avoid making the call altogether, display a warning, but let the user continue:
Checklist
Delete any items that are not applicable to this PR.
For maintainers