DEPR: deprecate dates-with-datetime64 in _maybe_downcast_for_indexing#64871
Open
jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
Open
DEPR: deprecate dates-with-datetime64 in _maybe_downcast_for_indexing#64871jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
jbrockmendel wants to merge 1 commit intopandas-dev:mainfrom
Conversation
7c6a35d to
eefc775
Compare
2 tasks
eefc775 to
eece8bc
Compare
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>
eece8bc to
3c42a7a
Compare
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.
Summary
Index._maybe_downcast_for_indexingthat implicitly converts sequences ofdatetime.dateobjects toDatetimeIndexwhen joining or indexingjoin, alignment, andget_indexerfallback (when_maybe_cast_listlike_indexerreturns object dtype, e.g. mixed date/Timestamp lists)_infer_matchespath (coveringequalsand the primary_maybe_cast_listlike_indexerconversion for pure date-object targets) will be handled in a separate PRcloses #62158
Test plan
Pandas4WarningDatetimeIndex.joinwith date-object Index🤖 Generated with Claude Code