Raviston6296 opened a new pull request, #59949:
URL: https://github.com/apache/spark/pull/59949

   ### What changes were proposed in this pull request?
   
   This is a branch-4.0 follow-up to #59854 (SPARK-60608). It fixes 
`MLClassLoadingSuite."reject an RFormulaModel with a non-allowlisted nested 
stage"` so that it expects the `InvocationTargetException` thrown by 
`MLUtils.loadOperator` and asserts that its cause is the 
`MlUnsupportedException` raised by the allowlist check.
   
   ### Why are the changes needed?
   
   The test fails on branch-4.0:
   
   ```
   Expected exception org.apache.spark.sql.connect.ml.MlUnsupportedException to 
be thrown,
   but java.lang.reflect.InvocationTargetException was thrown
   ...
   Caused by: org.apache.spark.sql.connect.ml.MlUnsupportedException: 
[CONNECT_ML.UNSUPPORTED_EXCEPTION]
   ... The class org.apache.spark.sql.connect.ml.UnregisteredModel to be loaded 
is not in the allowlist.
   ```
   
   On master, `MLUtils.loadOperator` unwraps the `InvocationTargetException` 
thrown by the reflective `load` call (SPARK-51333). That change was reverted 
from branch-4.0, so on this branch the expected exception arrives wrapped. The 
allowlist itself works correctly. Only the test expectation is wrong for this 
branch.
   
   This breaks CI for every PR against branch-4.0, for example #59915.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, test-only.
   
   ### How was this patch tested?
   
   `build/sbt 'connect/testOnly *MLClassLoadingSuite'`
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to