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


##########
python/pyspark/pandas/data_type_ops/num_ops.py:
##########
@@ -196,7 +215,9 @@ def xor(self, left: IndexOpsLike, right: Any) -> 
SeriesOrIndex:
         elif _is_valid_for_logical_operator(right):
             right_is_boolean = _is_boolean_type(right)
 
-            def xor_func(left: Column, right: Any) -> Column:
+            Column = ConnectColumn if is_remote() else PySparkColumn
+
+            def xor_func(left: GenericColumn, right: Any) -> GenericColumn:
                 if not isinstance(right, Column):

Review Comment:
   ```suggestion
                   if not isinstance(right, (PySparkColumn, GenericColumn)):
   ```
   and remove `Column = ConnectColumn if is_remote() else PySparkColumn`



##########
python/pyspark/pandas/data_type_ops/num_ops.py:
##########
@@ -219,22 +240,23 @@ def pretty_name(self) -> str:
     def mul(self, left: IndexOpsLike, right: Any) -> SeriesOrIndex:
         _sanitize_list_like(right)
         if isinstance(right, IndexOpsMixin) and 
isinstance(right.spark.data_type, StringType):
-            return column_op(SF.repeat)(right, left)
+            return column_op(cast(Callable[..., GenericColumn], 
SF.repeat))(right, left)
 
         if not is_valid_operand_for_numeric_arithmetic(right):
             raise TypeError("Multiplication can not be applied to given 
types.")
 
         right = transform_boolean_operand_to_numeric(right, 
spark_type=left.spark.data_type)
+        Column: Type[GenericColumn] = ConnectColumn if is_remote() else 
PySparkColumn
         return column_op(Column.__mul__)(left, right)

Review Comment:
   ditto



-- 
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