wengh commented on code in PR #50531:
URL: https://github.com/apache/spark/pull/50531#discussion_r2036217835


##########
python/pyspark/sql/pandas/serializers.py:
##########
@@ -518,8 +528,7 @@ def _create_struct_array(self, df, arrow_struct_type, 
spark_type=None):
                 for i, field in enumerate(arrow_struct_type)
             ]
 
-        struct_names = [field.name for field in arrow_struct_type]
-        return pa.StructArray.from_arrays(struct_arrs, struct_names)
+        return pa.StructArray.from_arrays(struct_arrs, 
fields=list(arrow_struct_type))

Review Comment:
   correctly handle non nullable fields required by the arrow_struct_type schema



-- 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to