-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
pandas/core/internals/blocks.py
Outdated
@@ -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): |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm.
needs a rebase as well |
ping on green. |
ping |
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.