HyukjinKwon commented on code in PR #40722:
URL: https://github.com/apache/spark/pull/40722#discussion_r1161531771
##########
python/pyspark/pandas/data_type_ops/date_ops.py:
##########
@@ -80,35 +76,33 @@ def rsub(self, left: IndexOpsLike, right: Any) ->
SeriesOrIndex:
)
if isinstance(right, datetime.date) and not isinstance(right,
datetime.datetime):
warnings.warn(msg, UserWarning)
- return -column_op(cast(Callable[..., GenericColumn], F.datediff))(
- left, F.lit(right)
- ).astype("long")
+ return -column_op(F.datediff)(left, F.lit(right)).astype("long")
else:
raise TypeError("Date subtraction can only be applied to date
series.")
def lt(self, left: IndexOpsLike, right: Any) -> SeriesOrIndex:
from pyspark.pandas.base import column_op
_sanitize_list_like(right)
- return column_op(cast(Callable[..., GenericColumn],
Column.__lt__))(left, right)
+ return column_op(Column.__lt__)(left, right)
Review Comment:
This seems like always using non Spark Column. Is this correct?
--
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]