Skip to content

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