-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Change in behavior of DatetimeIndex + Offset #22465
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
Comments
Hmm if I had to guess, https://github.com/pandas-dev/pandas/pull/18952/files#diff-63e1050a658278e30a3e7a744c4d6435R1324 is the line directly to blame, which seems pretty intentional :) |
@TomAugspurger thanks for spotting this. It seems like the problem is a bit deeper than the line you're pointing to - I'll take a closer look and see if I can fix it. |
Fails for me on master. In [1]: import pandas as pd
...:
...: offset = pd.tseries.offsets.Week(weekday=6)
...: idx = pd.DatetimeIndex(['1999-12-26', '2000-05-14'])
...:
...: assert (idx[0] + offset) == (idx + offset)[0]
...:
...:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-1-8c110b991a5b> in <module>()
4 idx = pd.DatetimeIndex(['1999-12-26', '2000-05-14'])
5
----> 6 assert (idx[0] + offset) == (idx + offset)[0]
AssertionError:
are your C-extensions up to date? |
@TomAugspurger Sorry that was a mistake on my part. Forgot that I had made some changes that I didn't stash before testing. |
bisected to #18952
Before that the assertion was true, after it's false
cc @reidy-p is this an expected change due to #18952, or a new bug? If it's intentional, we should document that.
The text was updated successfully, but these errors were encountered: