Skip to content

DEPR: deprecate dates-with-datetime64 in _maybe_downcast_for_indexing#64871

Open
jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
jbrockmendel:depr-dates-with-dt64
Open

DEPR: deprecate dates-with-datetime64 in _maybe_downcast_for_indexing#64871
jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
jbrockmendel:depr-dates-with-dt64

Conversation

@jbrockmendel
Copy link
Copy Markdown
Member

Summary

  • Deprecates the special case in Index._maybe_downcast_for_indexing that implicitly converts sequences of datetime.date objects to DatetimeIndex when joining or indexing
  • This path is reached via join, alignment, and get_indexer fallback (when _maybe_cast_listlike_indexer returns object dtype, e.g. mixed date/Timestamp lists)
  • The _infer_matches path (covering equals and the primary _maybe_cast_listlike_indexer conversion for pure date-object targets) will be handled in a separate PR

closes #62158

Test plan

  • Existing tests updated to expect Pandas4Warning
  • New test for DatetimeIndex.join with date-object Index
  • Full DatetimeIndex, indexing, join, alignment, reindex, and parser test suites pass

🤖 Generated with Claude Code

@jbrockmendel jbrockmendel added the Deprecate Functionality to remove in pandas label Mar 26, 2026
@jbrockmendel jbrockmendel force-pushed the depr-dates-with-dt64 branch from 7c6a35d to eefc775 Compare March 26, 2026 01:51
@jbrockmendel jbrockmendel added the Mothballed Temporarily-closed PR the author plans to return to label Mar 27, 2026
@jbrockmendel jbrockmendel reopened this Apr 3, 2026
@jbrockmendel jbrockmendel added datetime.date stdlib datetime.date support and removed Mothballed Temporarily-closed PR the author plans to return to labels Apr 3, 2026
@jbrockmendel jbrockmendel force-pushed the depr-dates-with-dt64 branch from eefc775 to eece8bc Compare April 3, 2026 22:05
@jbrockmendel jbrockmendel added the Mothballed Temporarily-closed PR the author plans to return to label Apr 8, 2026
@jbrockmendel jbrockmendel removed the Mothballed Temporarily-closed PR the author plans to return to label Apr 8, 2026
@jbrockmendel jbrockmendel reopened this Apr 8, 2026
@jbrockmendel
Copy link
Copy Markdown
Member Author

Discussed on today's dev call and everyone was on board.

Deprecate the special case in Index._maybe_downcast_for_indexing that
implicitly converts sequences of datetime.date objects to DatetimeIndex
when joining or indexing. This affects join, alignment, and get_indexer
fallback paths where _maybe_cast_listlike_indexer does not handle the
conversion.

closes pandas-dev#62158

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbrockmendel jbrockmendel force-pushed the depr-dates-with-dt64 branch from eece8bc to 3c42a7a Compare April 8, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datetime.date stdlib datetime.date support Deprecate Functionality to remove in pandas

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API: indexing dates-with-datetime64

1 participant