uros-b commented on code in PR #57552:
URL: https://github.com/apache/spark/pull/57552#discussion_r3657743301
##########
mllib/src/test/scala/org/apache/spark/ml/feature/RFormulaSuite.scala:
##########
@@ -54,6 +54,15 @@ class RFormulaSuite extends MLTest with DefaultReadWriteTest
{
ParamsSuite.checkParams(new RFormula())
}
+ test("RFormulaModel estimated size") {
+ val dataset = Seq(("a", 1.0), ("b", 2.0), ("c", 3.0)).toDF("category",
"label")
+ val model = new RFormula().setFormula("label ~ category").fit(dataset)
+ val maxSize = 1024 * 16
+ assert(
+ model.estimatedSize < maxSize,
+ s"Estimation (${model.estimatedSize}) should be less than $maxSize")
+ }
Review Comment:
The new test asserts only an upper bound (estimatedSize < 16KiB). It
genuinely fails without the fix (the default walk blows past 16KiB via
SparkSession), so it is a real regression guard, but a buggy implementation
returning 0 or a too-small value would also pass. Please add a lower bound to
match that standard from predecessor PRs.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]