This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a9cd991f6c [SPARK-41784][CONNECT][PYTHON] Add missing `__rmod__` in 
Column
2a9cd991f6c is described below

commit 2a9cd991f6cfc785d83f591a4b94392572fa14c5
Author: Ruifeng Zheng <[email protected]>
AuthorDate: Sat Dec 31 09:52:49 2022 +0900

    [SPARK-41784][CONNECT][PYTHON] Add missing `__rmod__` in Column
    
    ### What changes were proposed in this pull request?
    Add missing `__rmod__` in Column
    
    ### Why are the changes needed?
    to be consistent with PySpark
    
    ### Does this PR introduce _any_ user-facing change?
    no
    
    ### How was this patch tested?
    existing UT
    
    Closes #39303 from zhengruifeng/connect_column_rmod.
    
    Authored-by: Ruifeng Zheng <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 python/pyspark/sql/connect/column.py                    | 1 +
 python/pyspark/sql/tests/connect/test_connect_column.py | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/pyspark/sql/connect/column.py 
b/python/pyspark/sql/connect/column.py
index e694b71754e..d1e4b00f779 100644
--- a/python/pyspark/sql/connect/column.py
+++ b/python/pyspark/sql/connect/column.py
@@ -122,6 +122,7 @@ class Column:
     __rmul__ = _bin_op("*", reverse=True)
     __rdiv__ = _bin_op("/", reverse=True)
     __rtruediv__ = _bin_op("/", reverse=True)
+    __rmod__ = _bin_op("%", reverse=True)
     __pow__ = _bin_op("power")
     __rpow__ = _bin_op("power", reverse=True)
     __ge__ = _bin_op(">=")
diff --git a/python/pyspark/sql/tests/connect/test_connect_column.py 
b/python/pyspark/sql/tests/connect/test_connect_column.py
index f7ce6de8922..44b1d7f6a01 100644
--- a/python/pyspark/sql/tests/connect/test_connect_column.py
+++ b/python/pyspark/sql/tests/connect/test_connect_column.py
@@ -796,8 +796,8 @@ class SparkConnectTests(SparkConnectSQLTestCase):
         )
 
         self.assert_eq(
-            cdf.select(cdf.a % cdf["b"], cdf["a"] % 2).toPandas(),
-            sdf.select(sdf.a % sdf["b"], sdf["a"] % 2).toPandas(),
+            cdf.select(cdf.a % cdf["b"], cdf["a"] % 2, 12 % cdf.c).toPandas(),
+            sdf.select(sdf.a % sdf["b"], sdf["a"] % 2, 12 % sdf.c).toPandas(),
         )
 
         self.assert_eq(


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

Reply via email to