You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "uros-b (via GitHub)" <gi...@apache.org> on 2026/07/27 13:43:31 UTC

Re: [PR] [SPARK-58360][ML][CONNECT] Avoid nested parent overcount in RFormulaModel size estimate [spark]

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org