[
https://issues.apache.org/jira/browse/SPARK-41852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17653750#comment-17653750
]
Sandeep Singh commented on SPARK-41852:
---------------------------------------
[~podongfeng] these are from the doctests
{code:java}
>>> from pyspark.sql.functions import pmod
>>> df = spark.createDataFrame([
... (1.0, float('nan')), (float('nan'), 2.0), (10.0, 3.0),
... (float('nan'), float('nan')), (-3.0, 4.0), (-10.0, 3.0),
... (-5.0, -6.0), (7.0, -8.0), (1.0, 2.0)],
... ("a", "b"))
>>> df.select(pmod("a", "b")).show() {code}
> Fix `pmod` function
> -------------------
>
> Key: SPARK-41852
> URL: https://issues.apache.org/jira/browse/SPARK-41852
> Project: Spark
> Issue Type: Sub-task
> Components: Connect, PySpark
> Affects Versions: 3.4.0
> Reporter: Sandeep Singh
> Priority: Major
> Fix For: 3.4.0
>
>
> {code:java}
> File
> "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/functions.py",
> line 622, in pyspark.sql.connect.functions.pmod
> Failed example:
> df.select(pmod("a", "b")).show()
> Expected:
> +----------+
> |pmod(a, b)|
> +----------+
> | NaN|
> | NaN|
> | 1.0|
> | NaN|
> | 1.0|
> | 2.0|
> | -5.0|
> | 7.0|
> | 1.0|
> +----------+
> Got:
> +----------+
> |pmod(a, b)|
> +----------+
> | null|
> | null|
> | 1.0|
> | null|
> | 1.0|
> | 2.0|
> | -5.0|
> | 7.0|
> | 1.0|
> +----------+
> <BLANKLINE>{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]