viirya commented on a change in pull request #26547: [SPARK-29914][ML] ML 
models attach metadata in `transform`/`transformSchema`
URL: https://github.com/apache/spark/pull/26547#discussion_r348282122
 
 

 ##########
 File path: mllib/src/test/scala/org/apache/spark/ml/util/MLTest.scala
 ##########
 @@ -64,6 +65,36 @@ trait MLTest extends StreamTest with TempDirectory { self: 
Suite =>
     }
   }
 
+  private[ml] def checkVectorSizeOnDF(
+      dataframe: DataFrame,
+      vecColName: String,
+      vecSize: Int): Unit = {
+    import dataframe.sparkSession.implicits._
+    val group = AttributeGroup.fromStructField(dataframe.schema(vecColName))
+    assert(group.size === vecSize)
 
 Review comment:
   Can we add some error message to explain it when the condition fails?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to