HyukjinKwon commented on code in PR #40722:
URL: https://github.com/apache/spark/pull/40722#discussion_r1161533297


##########
python/pyspark/pandas/data_type_ops/num_ops.py:
##########
@@ -392,11 +522,16 @@ def rfloordiv(self, left: IndexOpsLike, right: Any) -> 
SeriesOrIndex:
         if not isinstance(right, numbers.Number):
             raise TypeError("Floor division can not be applied to given 
types.")
 
-        def rfloordiv(left: GenericColumn, right: Any) -> GenericColumn:
+        if is_remote():
+            from pyspark.sql.connect.column import Column as ConnectColumn
+
+            Column = ConnectColumn
+        else:
+            Column = PySparkColumn  # type: ignore[assignment]
+
+        def rfloordiv(left: Column, right: Any) -> Column:  # type: 
ignore[valid-type]

Review Comment:
   Just use `PySparkColumn` for type hints



##########
python/pyspark/pandas/data_type_ops/num_ops.py:
##########
@@ -494,13 +629,18 @@ def rpow(self, left: IndexOpsLike, right: Any) -> 
SeriesOrIndex:
         if not isinstance(right, numbers.Number):
             raise TypeError("Exponentiation can not be applied to given 
types.")
 
-        Column = ConnectColumn if is_remote() else PySparkColumn
+        if is_remote():
+            from pyspark.sql.connect.column import Column as ConnectColumn
+
+            Column = ConnectColumn
+        else:
+            Column = PySparkColumn  # type: ignore[assignment]
 
-        def rpow_func(left: GenericColumn, right: Any) -> GenericColumn:
+        def rpow_func(left: Column, right: Any) -> Column:  # type: 
ignore[valid-type]

Review Comment:
   Column



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to