devin-petersohn opened a new pull request, #55545:
URL: https://github.com/apache/spark/pull/55545

   ### What changes were proposed in this pull request?
   
   Add `axis` parameter to `DataFrame.shift()` in the pandas API on Spark. 
`axis=1` shifts values across columns using a `pandas_udf`, with a fast path 
for small DataFrames following the `compute.shortcut_limit` pattern.
   
   ### Why are the changes needed?
   
   pandas `DataFrame.shift()` supports `axis=1` but the pandas API on Spark did 
not.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. `DataFrame.shift()` now accepts `axis` (`0`, `1`, `'index'`, 
`'columns'`). Default behavior is unchanged.
   
   ### How was this patch tested?
   
   Added `test_shift_axis` covering axis=0/1, string aliases, various periods, 
fill_value, single-column, NaN values, multi-index columns, large dataset (UDF 
path), mixed types, empty DataFrame, and invalid axis.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (claude-opus-4-6)


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