-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
BUG: next_workday observance wrongly adds BDay to holidays on weekdays #58553
Comments
Hi @yaoyuan12. The docstring for However, I think the confusion arises from the docs defined here: https://pandas.pydata.org/docs/dev/user_guide/timeseries.html, where the We could either update the docs or try to deprecate the functions that give similar outputs. What do you think @mroeschke? |
Hm at the least based on the docs, I seem to have an impression that when I wrote the code, I checked and |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
In the example given, Christmas is defined as next_workday after 25th Dec. 2024-12-25 is a Wed; however the print result returns 2024-12-26. It seems to add 1 business day to 2024 Christmas even though it is a normal weekday.
Expected Behavior
Would expect holidays to return 2024-12-25 for observance=next_workday, since 2024-12-25 is a weekday.
Indeed this is what returns from a manual implementation of next_workday:
Installed Versions
INSTALLED VERSIONS
commit : bdc79c1
python : 3.11.5.final.0
python-bits : 64
OS : Linux
OS-release : 5.14.0-284.18.1.el9_2.x86_64
machine : x86_64
processor : x86_64
pandas : 2.2.1
numpy : 1.24.4
pytz : 2023.3.post1
dateutil : 2.8.2
The text was updated successfully, but these errors were encountered: