Hyukjin Kwon created SPARK-61929:
------------------------------------

             Summary: Make the class methods and static methods of the native 
ML classes PySpark's functions, and give PrefixSpan the clear of JavaParams
                 Key: SPARK-61929
                 URL: https://issues.apache.org/jira/browse/SPARK-61929
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: connect-rust-4.4.0
            Reporter: Hyukjin Kwon


The methods of the native ML classes are PySpark's functions (SPARK-61865's 
_synced): of PySpark's qualified name, module, docstring and signature, so that 
a call that does not bind raises PySpark's message. Their class methods and 
static methods were not:

- read, of JavaMLReadable.read and of the try_remote_read of a Pipeline or a 
validator;
- StringIndexerModel.from_labels and from_arrays_of_labels, and 
CountVectorizerModel.from_vocabulary;
- StopWordsRemover.loadDefaultStopWords.

They were PyO3's classmethod_descriptors, of other qualified names, no module, 
and signatures such as (cls, /). So LogisticRegression.read(1) raised 
"LogisticRegression.read() takes no arguments (1 given)", where PySpark raises 
"JavaMLReadable.read() takes 1 positional argument but 2 were given". Likewise, 
StringIndexerModel.from_labels with too many arguments counted no cls, where 
PySpark's message counts it.

PrefixSpan, a JavaParams of PySpark that has no persistence, had the clear of 
PySpark's Python Params, which unsets the param and needs one. PySpark's 
JavaParams.clear is a try_remote_intercept over Spark Connect: it takes any 
positional arguments and does nothing. So PrefixSpan().clear() raised "missing 
1 required positional argument: 'param'", where PySpark returns None, and 
clear(param) unset a param that PySpark's keeps.




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