Yicong-Huang commented on code in PR #54125:
URL: https://github.com/apache/spark/pull/54125#discussion_r2761981653


##########
python/pyspark/sql/pandas/serializers.py:
##########
@@ -319,11 +294,15 @@ def apply_type_coercion():
                             f"Expected: {expected_field_names}, but got: 
{actual_field_names}."
                         )
 
-                    coerced_arrays = []
-                    for i, field in enumerate(arrow_return_type):
-                        original_array = batch.column(i)
-                        coerced_array = self._create_array(original_array, 
field.type)
-                        coerced_arrays.append(coerced_array)
+                    coerced_arrays = [
+                        ArrowBatchTransformer.cast_array(

Review Comment:
   good catch! it is NOT for batch. I had [todo 
comments](https://github.com/apache/spark/pull/54125/changes#diff-d97b084cdf78f333ac97b2b14831ec37828d6f26e9d19ca5092642a14a5ad376R108-R110).
 In POC, this method will be replaced by `enforece_schema` transformer. In this 
PR I wanted to move this method as it is outside. Next I will make it a 
transformer. 
   
   



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