itholic opened a new pull request #33735: URL: https://github.com/apache/spark/pull/33735
### What changes were proposed in this pull request? This PR proposes to fix `Series.astype` when converting datetime to StringDtype, to match the behavior of pandas 1.3. In pandas < 1.3, ```python >>> pd.Series(["2020-10-27 00:00:01", None], name="datetime").astype("string") 0 2020-10-27 00:00:01 1 NaT Name: datetime, dtype: string ``` This is changed to ```python 0 2020-10-27 00:00:01 1 <NA> Name: datetime, dtype: string ``` in pandas >= 1.3, so we follow the behavior of latest pandas. ### Why are the changes needed? Because pandas-on-Spark always follow the behavior of latest pandas. ### Does this PR introduce _any_ user-facing change? Yes, the behavior is changed to latest pandas when converting datetime to nullable string (StringDtype) ### How was this patch tested? Unittest passed -- 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