-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: USFederalHolidayCalendar.holidays
inconsistently returns Index and not DateTimeIndex
#49075
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
3 tasks done
Labels
Comments
USFederalHolidayCalendar.holidays
inconsistently returns Index and not DateTimeIndex
Same behavior seen for March (the other month with no US Federal holidays), but interestingly the behavior is consistent for 2019.
|
4 tasks
Yeah, I missed some strange behavior that made my PR irrelevant. Documenting for the record here:
Example:
|
take |
This was referenced Aug 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The returned result should be type
DatetimeIndex
.Non-empty results are indeed of type
DatetimeIndex
. Furthermore, certain other empty results from other ranges (seen below in expected behavior) also have typeDatetimeIndex
.The return type is inconsistent.
Expected Behavior
Installed Versions
pandas : 1.5.0
numpy : 1.23.3
pytz : 2022.4
dateutil : 2.8.2
setuptools : 65.4.1
pip : 22.2.2
The text was updated successfully, but these errors were encountered: