Skip to content

REF: maybe_promote refactor/cleanup #28897

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 5 commits into from
Oct 12, 2019

Conversation

jbrockmendel
Copy link
Member

There is some casting we currently do in many places in this function. Instead this PR implements _ensure_dtype_type and calls it once at the end of the function.

Removes _check_lossless_cast which can be replaced with np.can_cast

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Clean labels Oct 11, 2019
@jreback jreback added this to the 1.0 milestone Oct 11, 2019
return False

# Start with exceptions in which we do _not_ cast to numpy types
if is_extension_array_dtype(dtype):
Copy link
Contributor

Choose a reason for hiding this comment

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

could be elif

Copy link
Member Author

Choose a reason for hiding this comment

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

changed

@jreback
Copy link
Contributor

jreback commented Oct 11, 2019

can you rebase

@jbrockmendel
Copy link
Member Author

rebased+green

@jreback jreback merged commit 4ade26b into pandas-dev:master Oct 12, 2019
@jreback
Copy link
Contributor

jreback commented Oct 12, 2019

thanks

@jbrockmendel jbrockmendel deleted the maybe_promote19 branch October 12, 2019 18:27
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants