Hyukjin Kwon created SPARK-62244:
------------------------------------

             Summary: Make the native ML classes of the Python client PySpark's 
in their property getters, models of a RemoteModelRef, pickles that reach a 
model, dir() and garbage collection
                 Key: SPARK-62244
                 URL: https://issues.apache.org/jira/browse/SPARK-62244
             Project: Spark
          Issue Type: Improvement
          Components: Connect
    Affects Versions: connect-rust-4.4.0
            Reporter: Hyukjin Kwon


An audit of docs/compatibility.md found four differences of the native ML 
classes of the Python client from PySpark 4.3.0:
- the getters of the native properties (e.g. LinearSVCModel.coefficients.fget) 
are the client's helpers, not PySpark's, in module, qualified name, signature, 
annotations and docstring;
- a model built from a RemoteModelRef (e.g. LinearSVCModel(RemoteModelRef(id))) 
raises AssertionError, where PySpark makes the model of that server-side 
object, with its ML-cache lifetime;
- the pickle of a Column of a model's transform (e.g. pickle.dumps(t.exists())) 
succeeds, where PySpark fails with its lock's TypeError, and the other subquery 
forms and deep copies differ in the same way;
- dir() lists extra members (__del__ of Pipeline, OneVsRest and the validators, 
_setParams of feature stages, __signature__, and others).
The native ML classes also report none of their Python objects to the garbage 
collector, so a cycle such as summary.model = model is never collected and the 
model stays in the ML cache.
Make them behave as PySpark's.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to