[
https://issues.apache.org/jira/browse/SPARK-44033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17746167#comment-17746167
]
Haejoon Lee commented on SPARK-44033:
-------------------------------------
> Do we need to implement other binary ops just like this
Correct, basically we try to reuse the PySpark functions from JVM side
internally like
[https://github.com/apache/spark/blob/515dfc166a95ecc8decce0f0cd99e06fe395f94f/python/pyspark/sql/column.py#L277C1-L277C1.]
But in case we can't leverage it like this case, we should manually implement
this in Python code like
[https://github.com/apache/spark/blob/46440a4a542148bc05b8c0f80d1860e6380efdb6/python/pyspark/pandas/data_type_ops/base.py#L394C1-L394C1.]
> Support list-like for binary ops
> --------------------------------
>
> Key: SPARK-44033
> URL: https://issues.apache.org/jira/browse/SPARK-44033
> Project: Spark
> Issue Type: Bug
> Components: Pandas API on Spark
> Affects Versions: 3.5.0
> Reporter: Haejoon Lee
> Priority: Major
>
> We should fix the error below:
> {code:java}
> >>> pser = pd.Series([1, 2, 3, 4, 5, 6], name="x")
> >>> psser = ps.from_pandas(pser)
> >>> other = [np.nan, 1, 3, 4, np.nan, 6]
> >>> psser <= other
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/Users/haejoon.lee/Desktop/git_store/spark/python/pyspark/pandas/base.py",
> line 412, in __le__
> return self._dtype_op.le(self, other)
> File
> "/Users/haejoon.lee/Desktop/git_store/spark/python/pyspark/pandas/data_type_ops/num_ops.py",
> line 242, in le
> _sanitize_list_like(right)
> File
> "/Users/haejoon.lee/Desktop/git_store/spark/python/pyspark/pandas/data_type_ops/base.py",
> line 199, in _sanitize_list_like
> raise TypeError("The operation can not be applied to %s." %
> type(operand).__name__)
> TypeError: The operation can not be applied to list.{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]