HyukjinKwon opened a new pull request, #673:
URL: https://github.com/apache/spark-connect-rust/pull/673

   ### What changes were proposed in this pull request?
   
   A follow-up to #638 from its post-merge review.
   
   - `native_class` of `python/tests/_native_classes.py` takes the reference 
class only when the native module is not there, that is, a 
`ModuleNotFoundError` of `pyspark._pyspark`. Other errors propagate:
     - a native module that fails to load, such as one with a missing symbol;
     - a module that the native module imports and lacks.
   - Three helpers of `test_dropin_e2e.py` still fell back to the official 
class on any `ImportError`: those of the random forest regressor and of both 
decision trees. They now use `native_class` too.
   
   ### Why are the changes needed?
   
   Before, a broken native extension made these tests run the vendored 
`pyspark.ml` class silently, and pass.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, test-only.
   
   ### How was this patch tested?
   
   - A new offline test, 
`test_native_class_falls_back_only_when_the_native_module_is_absent` in 
`test_ml_offline.py`, checks three cases:
     - a plain `ImportError` propagates;
     - a `ModuleNotFoundError` of another module propagates;
     - an absent native module falls back to the reference class.
   - `test_ml_offline.py` passed 343 tests.
   - Against a Spark 4.3.0 Connect server, the three changed live tests passed.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   
   This pull request and its description were written by Isaac.
   


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