ueshin opened a new pull request, #54413: URL: https://github.com/apache/spark/pull/54413
### What changes were proposed in this pull request? Fix `StringOps` to make `str` dtype work properly. ### Why are the changes needed? In pandas 3, the default dtype for string is now `str` or `StringDtype(na_value=np.nan)`. This is one of extension dtypes, but actually handled as if non-extension dtypes. ```py >>> pser = pd.Series(["x", "y", "z", None]) >>> other_pser = pd.Series([None, "z", "y", "x"]) ``` - pandas 2 ```py >>> pser 0 x 1 y 2 z 3 None dtype: object >>> other_pser 0 None 1 z 2 y 3 x dtype: object >>> pser == other_pser 0 False 1 False 2 False 3 False dtype: bool ``` - pandas 3 ```py >>> pser 0 x 1 y 2 z 3 NaN dtype: str >>> other_pser 0 NaN 1 z 2 y 3 x dtype: str >>> pser == other_pser 0 False 1 False 2 False 3 False dtype: bool ``` ### Does this PR introduce _any_ user-facing change? Yes, it will behave more like pandas 3. ### How was this patch tested? The existing tests should pass. ### Was this patch authored or co-authored using generative AI tooling? No. -- 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]
