Yicong-Huang opened a new pull request, #53957:
URL: https://github.com/apache/spark/pull/53957

   ### What changes were proposed in this pull request?
   
   Extract `arrow_to_pandas` conversion logic from serializers into 
`ArrowArrayToPandasConversion.create_converter()` factory method in 
`conversion.py`.
   
   **Changes in `conversion.py`**:
   - Added `ArrowArrayToPandasConversion.create_converter()` factory method 
that creates a configurable converter function `(arrow_column, idx) -> 
pd.Series | pd.DataFrame`
   - Supports all conversion options: `timezone`, `struct_in_pandas`, 
`ndarray_as_list`, `df_for_struct`, `input_types`
   
   **Changes in `serializers.py`** (-65 lines):
   - Removed `ArrowStreamPandasSerializer.arrow_to_pandas()` method
   - Removed `ArrowStreamPandasUDFSerializer.arrow_to_pandas()` method  
   - Removed `_df_for_struct` and `_ndarray_as_list` instance fields (no longer 
needed)
   - Updated 7 serializers to use `self._arrow_to_pandas` directly
   
   ### Why are the changes needed?
   
   - **Separation of concerns**: conversion logic isolated from serializer 
classes
   - **Cleaner code**: removed 2 methods and 2 instance fields from serializers
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   - Existing serializer tests pass
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


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