You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/08/17 02:30:28 UTC

[GitHub] [spark] itholic commented on a change in pull request #33735: [SPARK-36387][PYTHON] Fix Series.astype from datetime to nullable string

itholic commented on a change in pull request #33735:
URL: https://github.com/apache/spark/pull/33735#discussion_r689988572



##########
File path: python/pyspark/pandas/data_type_ops/datetime_ops.py
##########
@@ -135,9 +136,7 @@ def astype(self, index_ops: IndexOpsLike, dtype: Union[str, type, Dtype]) -> Ind
         elif isinstance(spark_type, StringType):
             if isinstance(dtype, extension_dtypes):
                 # seems like a pandas' bug?
-                scol = F.when(index_ops.spark.column.isNull(), str(pd.NaT)).otherwise(
-                    index_ops.spark.column.cast(spark_type)
-                )
+                return _as_string_type(index_ops, dtype)

Review comment:
       Sounds good!




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

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



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