Skip to content

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

Closed
wants to merge 1 commit into from
Closed

BUG: DataFrame.to_records() bug in converting datetime64 index #14044

wants to merge 1 commit into from

Conversation

amolkahat
Copy link
Contributor

BUG: DataFrame.to_records() bug in converting datetime64 index with timezone #13937

@jreback
Copy link
Contributor

jreback commented Aug 19, 2016

needs tests and a whats new note.

@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Timezones Timezone data dtype labels Aug 19, 2016
@amolkahat
Copy link
Contributor Author

@jreback Tests for this issue is already present in file pandas/pandas/tests/frame/test_convert_to.py.

@jreback
Copy link
Contributor

jreback commented Sep 1, 2016

if there were tests then your change would fail. pls add them

@jreback
Copy link
Contributor

jreback commented Sep 1, 2016

there are very minimal tests in any event
and certainly nothing related to conversions of tz

@codecov-io
Copy link

codecov-io commented Oct 7, 2016

Current coverage is 85.26% (diff: 100%)

Merging #14044 into master will not change coverage

@@             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          

Powered by Codecov. Last update d98e982...2460a7d

@amolkahat
Copy link
Contributor Author

@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."

@jreback
Copy link
Contributor

jreback commented Oct 7, 2016

you need to lint the code as indicated.

@amolkahat
Copy link
Contributor Author

@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,
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants