You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "devin-petersohn (via GitHub)" <gi...@apache.org> on 2026/03/02 14:21:08 UTC
Re: [PR] [SPARK-46161][PS] Add axis=1 support for DataFrame.diff [spark]
devin-petersohn commented on code in PR #54516:
URL: https://github.com/apache/spark/pull/54516#discussion_r2872719147
##########
python/pyspark/pandas/frame.py:
##########
@@ -4827,15 +4827,14 @@ def shift(self, periods: int = 1, fill_value: Optional[Any] = None) -> "DataFram
lambda psser: psser._shift(periods, fill_value), should_resolve=True
)
- # TODO(SPARK-46161): axis should support 1 or 'columns' either at this moment
def diff(self, periods: int = 1, axis: Axis = 0) -> "DataFrame":
"""
First discrete difference of element.
Calculates the difference of a DataFrame element compared with another element in the
DataFrame (default is the element in the same column of the previous row).
- .. note:: the current implementation of diff uses Spark's Window without
+ .. note:: When ``axis=0``, the current implementation of diff uses Spark's Window without
Review Comment:
Filed here: https://issues.apache.org/jira/browse/SPARK-55792
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org