Spenserrrr opened a new pull request, #58504:
URL: https://github.com/apache/spark/pull/58504

   ### What changes were proposed in this pull request?
   
   `ArrowArrayToPandasConversion.convert_numpy` ended with 
`series.rename(ser_name)`, but `Series.rename` is not an in-place rename: 
pandas implements it as `self.copy(deep=False)` followed by setting the name. 
The Series is created inside `convert_numpy`, so this names it in place instead.
   
   This also adds `python/benchmarks/bench_arrow_to_pandas.py`, since nothing 
in the committed ASV suite exercised the Arrow-to-pandas converter.
   
   ### Why are the changes needed?
   
   The copy runs per column per batch and removes ~20-38us of fixed cost that 
does not scale with row count, so it matters most for wide or small batches. 
With the new benchmark, 50 `long` columns go from 2.63ms to 1.64ms at 10k rows; 
a `timestamp` batch gains less (1.06x) and `string` columns are unaffected, as 
they take `convert_legacy`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. The returned Series is identical.
   
   ### How was this patch tested?
   
   Existing `test_conversion.py` and `test_pandas_udf_scalar.py` pass, plus a 
new test pinning that `convert_numpy` reads the Arrow field name before 
`preprocess_time`, whose `pa.compute` kernels return a new array without it; 
moving that capture below `preprocess_time` fails only the new test.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5)
   


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