Skip to content

REF: move convert_scalar out of cython #31672

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 4 commits into from
Feb 5, 2020

Conversation

jbrockmendel
Copy link
Member

There's nothing about this that particularly benefits from being in cython (I think until recently this was used within index.pyx) and its clearer in python. Plus we get a slightly smaller/faster build.

@@ -3204,3 +3205,34 @@ def _putmask_preserve(nv, n):
v = v.astype(dtype)

return _putmask_preserve(v, n)


def _convert_scalar_for_putitemlike(scalar, dtype: np.dtype):
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe in pandas.core.dtypes.cast ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. With convert_scalar out of libindex, we can move validate_numeric_casting to core.dtypes.cast as well (and after #31662 we'll be able to get rid of libindex.get_value_at, plus util.get_value_at and util.validate_indexer!)

Copy link
Contributor

Choose a reason for hiding this comment

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

sgtm.

@jreback jreback added the Dtype Conversions Unexpected or buggy dtype conversions label Feb 5, 2020
@jreback
Copy link
Contributor

jreback commented Feb 5, 2020

needs a rebase as well

@jreback jreback added this to the 1.1 milestone Feb 5, 2020
@jreback
Copy link
Contributor

jreback commented Feb 5, 2020

ping on green.

@jbrockmendel
Copy link
Member Author

ping

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants