diff --git a/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/anomaly/MultivariateAnomalyDetection.scala b/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/anomaly/MultivariateAnomalyDetection.scala index af91385e3f..168bd35213 100644 --- a/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/anomaly/MultivariateAnomalyDetection.scala +++ b/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/anomaly/MultivariateAnomalyDetection.scala @@ -166,7 +166,7 @@ object MADUtils extends Logging { val modelStatus = modelInfo("status").asInstanceOf[JsString].value.toLowerCase modelStatus match { case "failed" => - val errors = modelInfo("errors").convertTo[Seq[DMAError]].toJson.compactPrint + val errors = modelInfo("errors").toJson.compactPrint throw new RuntimeException(s"Caught errors during fitting: $errors") case "created" | "running" => throw new RuntimeException(s"model $modelId is not ready yet") @@ -258,7 +258,6 @@ trait MADHttpRequest extends HasURL with HasSubscriptionKey with HasAsyncReply { } } else { val error = IOUtils.toString(response.entity.get.content, "UTF-8") - .parseJson.convertTo[DMAError].toJson.compactPrint throw new RuntimeException(s"Caught error: $error") } } @@ -514,7 +513,7 @@ class SimpleFitMultivariateAnomaly(override val uid: String) extends Estimator[S val modelId = response("modelId").convertTo[String] if (modelInfo("status").asInstanceOf[JsString].value.toLowerCase() == "failed") { - val errors = modelInfo("errors").convertTo[Seq[DMAError]].toJson.compactPrint + val errors = modelInfo("errors").toJson.compactPrint throw new RuntimeException(s"Caught errors during fitting: $errors") } diff --git a/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/anomaly/MultivariateAnomalyDetectorSchemas.scala b/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/anomaly/MultivariateAnomalyDetectorSchemas.scala index c4616bb84c..1b73b6ae1f 100644 --- a/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/anomaly/MultivariateAnomalyDetectorSchemas.scala +++ b/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/anomaly/MultivariateAnomalyDetectorSchemas.scala @@ -28,7 +28,7 @@ case class DMASummary(status: String, object DMAError extends SparkBindings[DMAError] -case class DMAError(code: String, message: String) +case class DMAError(code: Option[String], message: Option[String]) case class DMAVariableState(variable: Option[String], filledNARatio: Option[Double],