Skip to content

Conversation

@benwtrent
Copy link
Member

Adds validations making sure that

  • input.field_names is not empty
  • ensemble.trained_models is not empty
  • tree.feature_names is not empty

closes #51354

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

Copy link
Contributor

@przemekwitek przemekwitek left a comment

Choose a reason for hiding this comment

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

LGTM

@Override
public void validate() {
if (this.models.isEmpty()) {
throw ExceptionsHelper.badRequestException("[trained_models] must not be empty");
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to use TRAINED_MODELS.getPreferredName() here rather than literal?

@Override
public void validate() {
if (featureNames.isEmpty()) {
throw ExceptionsHelper.badRequestException("[feature_names] must not be empty for tree model");
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to use FEATURE_NAMES.getPreferredName() here rather than literal?

@benwtrent benwtrent merged commit 4099c0a into elastic:master Jan 24, 2020
@benwtrent benwtrent deleted the feature/ml-inference-adding-more-put-validations branch January 24, 2020 13:22
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jan 24, 2020
Adds validations making sure that

* `input.field_names` is not empty
* `ensemble.trained_models` is not empty
* `tree.feature_names` is not empty

closes elastic#51354
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jan 24, 2020
Adds validations making sure that

* `input.field_names` is not empty
* `ensemble.trained_models` is not empty
* `tree.feature_names` is not empty

closes elastic#51354
benwtrent added a commit that referenced this pull request Jan 24, 2020
Adds validations making sure that

* `input.field_names` is not empty
* `ensemble.trained_models` is not empty
* `tree.feature_names` is not empty

closes #51354
@benwtrent benwtrent added v7.6.0 and removed v7.6.1 labels Jan 24, 2020
benwtrent added a commit that referenced this pull request Jan 24, 2020
Adds validations making sure that

* `input.field_names` is not empty
* `ensemble.trained_models` is not empty
* `tree.feature_names` is not empty

closes #51354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML] Inference PUT: 500 returned when trained_model.ensemble.trained_models is an empty array

4 participants