-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: DataFrame.to_records() bug in converting datetime64 index #14044
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
needs tests and a whats new note. |
@jreback Tests for this issue is already present in file pandas/pandas/tests/frame/test_convert_to.py. |
if there were tests then your change would fail. pls add them |
there are very minimal tests in any event |
Current coverage is 85.26% (diff: 100%)@@ master #14044 diff @@
==========================================
Files 140 140
Lines 50634 50634
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 43173 43173
Misses 7461 7461
Partials 0 0
|
@jreback This build with python2.7 failed. But there is not an error with the tests, there is an error with the Travis CI. It shows error like "The command "ci/lint.sh" exited with 1." |
you need to lint the code as indicated. |
@jreback Build is successful. Please take a look. |
df = DataFrame({'datetime': data}) | ||
df.set_index('datetime', inplace=True) | ||
dfgmt = df.tz_convert("GMT") | ||
self.assertNotEqual(df.to_records()['datetime'][0].tzinfo, |
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.
construct the expected frame and use assert_frame_equal
(and same below)
This PR fixes index for datetime64 conversion. Also, update tests - pandas/pandas/tests/tests_convert_to.py Fixes #13937
BUG: DataFrame.to_records() bug in converting datetime64 index with timezone #13937