Skip to content

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

Merged
mroeschke merged 1 commit into
pandas-dev:mainfrom
jbrockmendel:depr-dates-with-dt64
Apr 10, 2026
Merged

DEPR: deprecate dates-with-datetime64 in _maybe_downcast_for_indexing#64871
mroeschke merged 1 commit into
pandas-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 8184235 to 49587e8 Compare April 10, 2026 00:00
@mroeschke mroeschke added this to the 3.1 milestone Apr 10, 2026
@mroeschke mroeschke merged commit ef08105 into pandas-dev:main Apr 10, 2026
45 checks passed
@mroeschke

Copy link
Copy Markdown
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the depr-dates-with-dt64 branch April 10, 2026 17:25
Sharl0tteIsTaken added a commit to Sharl0tteIsTaken/pandas that referenced this pull request Apr 12, 2026
…-comparison

* upstream/main:
  PERF: use lookup instead of hash_inner_join for merge with unique right keys (pandas-dev#64691)
  BUG : update `SeriesGroupBy.ohlc()` to honor `as_index=False` (pandas-dev#65141)
  PERF: Use DataFrame-level reductions in DataFrame.agg with list of funcs (pandas-dev#65031)
  DOC: document required external libraries in read_* I/O docstrings (pandas-dev#65143)
  DOC: improve MultiIndex.is_monotonic_increasing/decreasing docstrings (pandas-dev#65154)
  BUG: Raise ValueError for non-boolean numeric_only in DataFrame/Series reductions (GH#53098) (pandas-dev#65131)
  BUG: Timedelta.round() raises ZeroDivisionError when internal unit is 's' and target frequency is sub-second (pandas-dev#64836)
  ENH: Add replace method to Index (closes pandas-dev#19495) (pandas-dev#65099)
  PERF: improve StringArray.isna (pandas-dev#57733)
  BUG: read parquet files with older pytz (DEP: keep lower pytz minimum version) (pandas-dev#65133)
  DEPR: deprecate dates-with-datetime64 in _maybe_downcast_for_indexing (pandas-dev#64871)
  DOC: note that DataFrame.values is not writeable (pandas-dev#65142)
  CLN: Update groupby observed defaults (pandas-dev#65148)
  PERF: avoid materializing values[indexer] in Block.setitem (pandas-dev#64251)
  DOC: update GroupBy.sum/min/max See Also sections (pandas-dev#65144)
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

2 participants