diff --git a/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts b/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts index 3be8679830423..e160126833801 100644 --- a/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts +++ b/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts @@ -151,8 +151,15 @@ export const ml = { }); }, - validateJob({ job }: { job: Job }) { - const body = JSON.stringify({ job }); + validateJob(payload: { + job: Job; + duration: { + start?: number; + end?: number; + }; + fields?: any[]; + }) { + const body = JSON.stringify(payload); return http({ path: `${basePath()}/validate/job`, method: 'POST', diff --git a/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.ts b/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.ts index 0c431f6a07563..16a48addfeaf4 100644 --- a/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.ts +++ b/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.ts @@ -46,7 +46,7 @@ export async function validateModelMemoryLimit( // if there is no duration, do not run the estimate test const runCalcModelMemoryTest = - duration && typeof duration?.start !== undefined && duration?.end !== undefined; + duration && duration?.start !== undefined && duration?.end !== undefined; // retrieve the max_model_memory_limit value from the server // this will be unset unless the user has set this on their cluster