-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REF: Block._astype defer to astype_nansafe in more cases #38562
Conversation
where is this test case changed? |
we dont have a test for this; #38508 introduced new ones |
I'm not sure about the new behaviour, I think this should at least have a release note if not reverted. old behaviour
new behaviour
|
@simonjayhawkins can u open a new issue - this is going to be very hard to revert - but i agree original behavior is correct so should fix |
Makes astype_nansafe for (td64|dt64) -> (object|str|string) match DTA/TDA/Series behavior.
Medium-term (weeks) the goal is to get rid of Block._astype altogether and just use astype_nansafe, which among other things will be helpful for ArrayManager.
This changes
Series[dt64].astype("string")
behavior in a way that causes a new xfail in test_astype_roundtrip, but as discussed in #36153 that test is already wrong for other reasons.This also has a side-effect of changing Series(dt64, dtype="Sparse[object]") behavior, discussed in #38508 as possibly not-desirable.