Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate partial slicing of unordered DatetimeIndex when both keys are not present #37819

Merged
merged 1 commit into from Nov 15, 2020

Conversation

phofl
Copy link
Member

@phofl phofl commented Nov 13, 2020

cc @jreback @jorisvandenbossche

This would deprecate #37796 before removing it.

@phofl phofl added Deprecate Functionality to remove in pandas Indexing Related to indexing on series/frames, not to indexes themselves labels Nov 13, 2020
@jreback jreback added this to the 1.2 milestone Nov 15, 2020
@jreback jreback merged commit f34fe62 into pandas-dev:master Nov 15, 2020
@jreback
Copy link
Contributor

jreback commented Nov 15, 2020

thanks @phofl

@phofl phofl deleted the 18531_deprecation branch November 15, 2020 17:41
wence- added a commit to wence-/pandas that referenced this pull request Jul 5, 2023
The intention of pandas-dev#37819 was to deprecate (removed in pandas-dev#49607) the
special case behaviour of non-monotonic datetime indexes, so that if
either slice bound is not in the index, a KeyError is raised.

However, the check only fired correctly for the case where the lower
bound was not in the index and either the upper bound was None or it
was _also_ not in the index.

Correct the logic here and adapt the one test that exercises this
behaviour.

Closes pandas-dev#53983.
wence- added a commit to wence-/pandas that referenced this pull request Jul 5, 2023
The intention of pandas-dev#37819 was to deprecate (removed in pandas-dev#49607) the
special case behaviour of non-monotonic datetime indexes, so that if
either slice bound is not in the index, a KeyError is raised.

However, the check only fired correctly for the case where the lower
bound was not in the index and either the upper bound was None or it
was _also_ not in the index.

Correct the logic here and adapt the one test that exercises this
behaviour.

Closes pandas-dev#53983.
mroeschke pushed a commit that referenced this pull request Jul 19, 2023
* Correct check when slicing non-monotonic datetime indexes

The intention of #37819 was to deprecate (removed in #49607) the
special case behaviour of non-monotonic datetime indexes, so that if
either slice bound is not in the index, a KeyError is raised.

However, the check only fired correctly for the case where the lower
bound was not in the index and either the upper bound was None or it
was _also_ not in the index.

Correct the logic here and adapt the one test that exercises this
behaviour.

Closes #53983.

* Modify more tests for updated behaviour

* Added whatsnew entry as bugfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants