zhengruifeng opened a new pull request, #57552: URL: https://github.com/apache/spark/pull/57552
### What changes were proposed in this pull request? This PR adds a specialized `RFormulaModel.estimatedSize` implementation. It counts the model metadata, the resolved formula, and the nested `PipelineModel` through its parent-safe estimate. ### Why are the changes needed? The default model-size estimate clears only the outer model parent. `RFormulaModel` retains its nested pipeline, whose stages can otherwise retain estimator-parent graphs and overcount Spark session or context state in ML Connect cache accounting. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added `RFormulaSuite` coverage that fits a categorical R formula and verifies that the fitted model estimate stays below the expected upper bound. Also ran `git diff --check`, ASCII, and source-line-length checks. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-5) -- 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]
