qlong commented on code in PR #53458:
URL: https://github.com/apache/spark/pull/53458#discussion_r2795506706


##########
python/pyspark/pandas/data_type_ops/base.py:
##########
@@ -199,8 +199,17 @@ def _as_string_type(
     else:
         casted = index_ops.spark.column.cast(spark_type)
         scol = F.when(index_ops.spark.column.isNull(), 
null_str).otherwise(casted)
+
+    # Always get nullable from the Spark schema after the cast.
+    # Binary->String can be nullable when UTF-8 validation is enabled.
+    temp_sdf = index_ops._internal.spark_frame.select(scol)

Review Comment:
   right. Moved it to binary_ops.py to reduce overhead



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