Skip to content

MAINT: Describe date_index as passed in date_to_index errors - #1020

Merged
bashtage merged 2 commits into
mainfrom
a90-date-index-series
Nov 11, 2026
Merged

bashtage merged 2 commits into
mainfrom
a90-date-index-series

Conversation

@bashtage

Copy link
Copy Markdown
Owner

Follow-up to #1016, from its review:

  • Docstring: the date_index entry of date_to_index lists Series: "DatetimeIndex, Series or ndarray".
  • Errors: they describe date_index as it was passed. Since BUG: Accept timezone-aware date Series #1016, a Series is converted to a DatetimeIndex before the checks, so an empty or unsorted Series was reported as shape (3,) (DatetimeIndex). It is now reported as (Series). The converted dates go into a separate variable, and _describe is called on the input.
  • Release note: adds a 9.0 note in Bug fixes for BUG: Accept timezone-aware date Series #1016, which was merged without one.

Checks

  • New test: test_date_to_index_error_describes_input covers an unsorted, a duplicated and an empty date index, as a Series and as a DatetimeIndex, with and without a time zone (12 cases). The 6 Series cases fail on main, and the 6 DatetimeIndex cases pass on both.
  • Test runs:
    • the utility tests and test_docstrings.py pass (1,927);
    • the univariate and utility tests that use dates, cutoffs, append or forecast pass (6,987).
  • Lint: ruff (lint and format), black, isort and flake8 pass, numpydoc lint passes, and mypy reports the same errors as on main.
  • Release note: the new lines are at most 88 columns and ASCII, and docutils parses 9.0.rst with no warnings.

🤖 Generated with Claude Code

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.
@bashtage
bashtage marked this pull request as ready for review November 11, 2026 16:54
@bashtage
bashtage merged commit 2800e6c into main Nov 11, 2026
12 of 25 checks passed
@bashtage
bashtage deleted the a90-date-index-series branch November 14, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant