Spenserrrr commented on code in PR #58751:
URL: https://github.com/apache/spark/pull/58751#discussion_r4010234767


##########
python/pyspark/sql/conversion.py:
##########
@@ -410,105 +401,159 @@ def convert_column(
                     assign_cols_by_name=assign_cols_by_name,
                     
int_to_decimal_coercion_enabled=int_to_decimal_coercion_enabled,
                     
ignore_unexpected_complex_type_values=ignore_unexpected_complex_type_values,
-                    is_legacy=is_legacy,
+                    use_legacy_error_handling=use_legacy_error_handling,
                 )
                 # Wrap the nested RecordBatch as a single StructArray column
-                return 
ArrowBatchTransformer.wrap_struct(nested_batch).column(0)
+                
converted.append(ArrowBatchTransformer.wrap_struct(nested_batch).column(0))
+            else:

Review Comment:
   Added an explicit type check with PySparkTypeError (UDF_RETURN_TYPE). Some 
scalar pandas UDF paths currently check the result’s length without requiring a 
Series, so an invalid return such as a list can reach here. I chose an 
exception rather than an assertion because this can be invalid user input, not 
just an internal programming error.



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