-
- Downloads
[SPARK-15243][ML][SQL][PYTHON] Add missing support for unicode in Param...
[SPARK-15243][ML][SQL][PYTHON] Add missing support for unicode in Param methods & functions in dataframe ## What changes were proposed in this pull request? This PR proposes to support unicodes in Param methods in ML, other missed functions in DataFrame. For example, this causes a `ValueError` in Python 2.x when param is a unicode string: ```python >>> from pyspark.ml.classification import LogisticRegression >>> lr = LogisticRegression() >>> lr.hasParam("threshold") True >>> lr.hasParam(u"threshold") Traceback (most recent call last): ... raise TypeError("hasParam(): paramName must be a string") TypeError: hasParam(): paramName must be a string ``` This PR is based on https://github.com/apache/spark/pull/13036 ## How was this patch tested? Unit tests in `python/pyspark/ml/tests.py` and `python/pyspark/sql/tests.py`. Author: hyukjinkwon <gurwls223@gmail.com> Author: sethah <seth.hendrickson16@gmail.com> Closes #17096 from HyukjinKwon/SPARK-15243.
Showing
- python/pyspark/ml/param/__init__.py 2 additions, 2 deletionspython/pyspark/ml/param/__init__.py
- python/pyspark/ml/tests.py 15 additions, 0 deletionspython/pyspark/ml/tests.py
- python/pyspark/sql/dataframe.py 11 additions, 11 deletionspython/pyspark/sql/dataframe.py
- python/pyspark/sql/tests.py 14 additions, 8 deletionspython/pyspark/sql/tests.py
Loading
Please register or sign in to comment