Skip to content

REF: use astype_array instead of astype_nansafe #50222

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

Merged
merged 2 commits into from
Dec 17, 2022

Conversation

jbrockmendel
Copy link
Member

Trying to ensure we have only one astype behavior.

The BaseParser change could change behavior if we can get there with dt64/td64 data (that includes at least one NaT) and an integer dtype, but we don't have any test cases that get there with dt64/td64 and it isn't clear to me if it is possible. If it is, the non-raising behavior here is more consistent with our other behavior.

@mroeschke mroeschke added Refactor Internal refactoring of code Dtype Conversions Unexpected or buggy dtype conversions labels Dec 13, 2022
@MarcoGorelli MarcoGorelli self-requested a review December 13, 2022 19:29
Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure, that we can't get there with date time data and another dtype (e.g. int64). The date conversion is done after _cast_types is called, so the values are still strings that look like dates.

@phofl phofl added this to the 2.0 milestone Dec 16, 2022
@mroeschke mroeschke merged commit e2598a1 into pandas-dev:main Dec 17, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-astype_nansafe-6 branch December 17, 2022 20:07
phofl pushed a commit to phofl/pandas that referenced this pull request Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants