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] Custom rule error reason can be confusing when the detector doesn't use any fields #32542

Closed
dolaru opened this issue Aug 1, 2018 · 0 comments
Assignees
Labels
>bug :ml Machine learning

Comments

@dolaru
Copy link
Member

dolaru commented Aug 1, 2018

Description

Found in 6.4.0-BC1

While creating a job, if the user tries to specify scope in a custom rule even though field_name, by_field_name, over_field_name or partition_field_name, the response root cause error message is:

Invalid detector rule: scope field 'someFieldName' is invalid; select from []

Note that the error reason offers an empty list as a choice for scope fields.

A better reason should be returned instead, stating that scope cannot be specified because the detector doesn't use a field_name, by_field_name, over_field_name or partition_field_name.

Steps to reproduce

  1. Send an API request to create a job (detector with no fields and custom rule with scope specified)
PUT _xpack/ml/anomaly_detectors/custom_rule_test
{
  "analysis_config": {
    "detectors": [
      {
        "function": "count",
        "custom_rules": [
          {
            "actions": [
              "skip_result"
            ],
            "scope": {
              "someFieldName": {
                "filter_id": "someFilterId",
                "filter_type": "include"
              }
            }
          }
        ]
      }
    ]
  },
  "data_description": {}
}
  1. Notice the issue in the response root cause error reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :ml Machine learning
Projects
None yet
Development

No branches or pull requests

2 participants