-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG fix IntegerArray.astype int -> uint #22441
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
BUG fix IntegerArray.astype int -> uint #22441
Conversation
@@ -409,8 +409,7 @@ def astype(self, dtype, copy=True): | |||
|
|||
# if we are astyping to an existing IntegerDtype we can fastpath | |||
if isinstance(dtype, _IntegerDtype): | |||
result = self._data.astype(dtype.numpy_dtype, | |||
casting='same_kind', copy=False) |
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.
@jreback do you remember what the reason was to explicitly put casting='same_kind'
?
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.
iirc was to make sure we were
only coercing actual ints (and would raise on floats)
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.
But since we have the if isinstance(dtype, _IntegerDtype):
, we are sure about that? (so it can never be a float 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.
it might have been an artificat.
Codecov Report
@@ Coverage Diff @@
## master #22441 +/- ##
=======================================
Coverage 92.05% 92.05%
=======================================
Files 169 169
Lines 50733 50733
=======================================
Hits 46702 46702
Misses 4031 4031
Continue to review full report at Codecov.
|
thanks! |
Closes #22440