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-DataFrame] Dataframe REST cleanups #39451

Merged
merged 6 commits into from
Feb 28, 2019

Conversation

hendrikmuhs
Copy link

fix a couple of odd behaviors of data frame transforms REST API's:

  • check if id from body and id from URL match if both are specified
  • do not allow a body for delete
  • allow get and stats without specifying an id

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

assertEquals("body_id", dataFrameTransformConfig.getId());

expectThrows(IllegalArgumentException.class,
() -> createDataFrameTransformConfigFromString(pivotTransform, "other_id"));
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also assert that the error message is as expected here. (For example this will detect if the body ID and URL ID are the wrong way around when the error message is formed.)

import java.io.IOException;
import java.util.Map;

public class DataFrameGetAndGetStatsIT extends DataFrameRestTestCase {
Copy link
Member

Choose a reason for hiding this comment

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

nit: All these tests seem like they could just be yml tests.

@hendrikmuhs
Copy link
Author

hendrikmuhs commented Feb 28, 2019

opened: #39497

(fails locally for a master build without this PR, therefore unrelated)

@hendrikmuhs
Copy link
Author

run elasticsearch-ci/1

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

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

LGTM

@hendrikmuhs hendrikmuhs merged commit f24fba7 into elastic:master Feb 28, 2019
hendrikmuhs pushed a commit to hendrikmuhs/elasticsearch that referenced this pull request Feb 28, 2019
fix a couple of odd behaviors of data frame transforms REST API's:

 -  check if id from body and id from URL match if both are specified
 -  do not allow a body for delete
 -  allow get and stats without specifying an id
hendrikmuhs pushed a commit that referenced this pull request Feb 28, 2019
fix a couple of odd behaviors of data frame transforms REST API's:

 -  check if id from body and id from URL match if both are specified
 -  do not allow a body for delete
 -  allow get and stats without specifying an id
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.

5 participants