Repository navigation
MAINT: Describe date_index as passed in date_to_index errors - #1020
Merged
Merged
Conversation
Follow-up to #1016. The errors for an empty or unsorted date_index describe it as it was passed, so a Series is reported as a Series and not as the DatetimeIndex it is converted to, and the docstring lists Series as an accepted type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1016, from its review:
date_indexentry ofdate_to_indexlistsSeries: "DatetimeIndex, Series or ndarray".date_indexas it was passed. Since BUG: Accept timezone-aware date Series #1016, aSeriesis converted to aDatetimeIndexbefore the checks, so an empty or unsortedSerieswas reported asshape (3,) (DatetimeIndex). It is now reported as(Series). The converted dates go into a separate variable, and_describeis called on the input.Checks
test_date_to_index_error_describes_inputcovers an unsorted, a duplicated and an empty date index, as aSeriesand as aDatetimeIndex, with and without a time zone (12 cases). The 6Seriescases fail on main, and the 6DatetimeIndexcases pass on both.test_docstrings.pypass (1,927);appendorforecastpass (6,987).9.0.rstwith no warnings.🤖 Generated with Claude Code