-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
CLN/BUG: Consolidate Index.astype and fix tz aware bugs #18937
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
Codecov Report
@@ Coverage Diff @@
## master #18937 +/- ##
==========================================
- Coverage 91.59% 91.59% -0.01%
==========================================
Files 150 150
Lines 48964 48939 -25
==========================================
- Hits 44850 44826 -24
+ Misses 4114 4113 -1
Continue to review full report at Codecov.
|
pandas/core/indexes/datetimes.py
Outdated
| return Index(self.values.astype('i8', copy=copy), name=self.name, | ||
| dtype='i8') | ||
| elif is_datetime64_ns_dtype(dtype): | ||
| if is_datetime64_ns_dtype(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.
can it be merged to datetimelike using is_dtype_equal(self.dtype, 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.
Nice catch. I think it can be merged all the way down to base.
|
lgtm. ex @sinhrks comment. ping when resolved. |
b812e6a to
d845613
Compare
|
Hello @jschendel! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on December 27, 2017 at 04:17 Hours UTC |
d845613 to
10753c1
Compare
10753c1 to
d7c7b9d
Compare
|
Made the change suggested by @sinhrks, and fixed #18951 at the same time, since it was closely tied to code I was changing without any other dependencies. Bringing Bringing |
|
thanks @jschendel nice patch! keep em coming! |
git diff upstream/master -u -- "*.py" | flake8 --diffOnly behavioral changes:
.astype(str)onTimedeltaIndexandPeriodIndex, which previously raised.RangeIndex.astype('int64')now remains aRangeIndexInt64Index