Skip to content

BUG/TST: Calling shift on a DatetimeIndex of length 0 returns an Index in… #13026

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

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Apr 29, 2016

No what's new as the fixed timing is unclear.

@sinhrks sinhrks added Bug Testing pandas testing functions or related to the test suite Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves labels Apr 29, 2016
@jreback jreback added this to the 0.18.1 milestone Apr 29, 2016
# GH 9903
for tz in [None, 'US/Eastern', 'Asia/Tokyo']:
idx = pd.DatetimeIndex([], name='xxx', tz=tz)
tm.assert_index_equal(idx.shift(0, freq='H'), idx)
Copy link
Contributor

@ssanderson ssanderson Apr 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want exact=True in all the assert_index_equal calls here. By default, assert_index_equal only asserts that both values are instances of Index.

EDIT: I was looking at an older version of pandas. It looks like this is no longer true on master. Carry on :).

@ssanderson
Copy link
Contributor

👍

@jreback jreback closed this in 62bedfd Apr 29, 2016
@jreback
Copy link
Contributor

jreback commented Apr 29, 2016

thanks @sinhrks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling shift on a DatetimeIndex of length 0 returns an Index instead of a DatetimeIndex
3 participants