HyukjinKwon commented on code in PR #40525:
URL: https://github.com/apache/spark/pull/40525#discussion_r1155889262
##########
python/pyspark/pandas/data_type_ops/num_ops.py:
##########
@@ -104,11 +110,13 @@ def pow(self, left: IndexOpsLike, right: Any) ->
SeriesOrIndex:
if not is_valid_operand_for_numeric_arithmetic(right):
raise TypeError("Exponentiation can not be applied to given
types.")
- def pow_func(left: Column, right: Any) -> Column:
+ Column = ConnectColumn if is_remote() else PySparkColumn
+
+ def pow_func(left: GenericColumn, right: Any) -> GenericColumn:
return (
- F.when(left == 1, left)
+ F.when(left == 1, left) # type: ignore
.when(F.lit(right) == 0, 1)
- .otherwise(Column.__pow__(left, right))
+ .otherwise(Column.__pow__(left, right)) # type: ignore
Review Comment:
ditto. `left.__pow__`
--
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]