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

Increase maximum forecast interval to 10 years. #41082

Merged
merged 3 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public static class Request extends JobTaskRequest<Request> implements ToXConten
public static final ParseField DURATION = new ParseField("duration");
public static final ParseField EXPIRES_IN = new ParseField("expires_in");

// Max allowed duration: 8 weeks
private static final TimeValue MAX_DURATION = TimeValue.parseTimeValue("56d", "");
// Max allowed duration: 10 years
private static final TimeValue MAX_DURATION = TimeValue.parseTimeValue("3650d", "");

private static final ObjectParser<Request, Void> PARSER = new ObjectParser<>(NAME, Request::new);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ setup:
job_id: "forecast-job"
duration: "-1s"

---
"Test forecast given duration is too large":
- do:
catch: /\[duration\] must be 3650d or less[:] \[3651d\]/
ml.forecast:
job_id: "forecast-job"
duration: "3651d"

---
"Test forecast given expires_in is negative":
- do:
Expand Down