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

DEPR: Enforce deprecations in indexes/datetimes.py #49607

Merged
merged 4 commits into from
Nov 10, 2022

Conversation

mroeschke
Copy link
Member

Introduced in #43504, #37819

@mroeschke mroeschke added the Deprecate Functionality to remove in pandas label Nov 9, 2022
@@ -433,9 +433,11 @@ Removal of prior version deprecations/changes
- Remove :meth:`DataFrameGroupBy.pad` and :meth:`DataFrameGroupBy.backfill` (:issue:`45076`)
- Remove ``numpy`` argument from :func:`read_json` (:issue:`30636`)
- Disallow passing abbreviations for ``orient`` in :meth:`DataFrame.to_dict` (:issue:`32516`)
- Disallow partial slicing on an unordered :class:`DatetimeIndex` with keys, which are not in Index. This now raises a ``KeyError`` (:issue:`18531`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"keys, which are not in Index" -> "keys which are not in the Index"?
"unordered" -> "non-monotonic"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Updated + greenish

@mroeschke mroeschke added this to the 2.0 milestone Nov 10, 2022
Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jbrockmendel jbrockmendel merged commit 47ecf8d into pandas-dev:main Nov 10, 2022
@jbrockmendel
Copy link
Member

thanks @mroeschke

@mroeschke mroeschke deleted the depr/rm/dti branch November 10, 2022 18:10
codamuse pushed a commit to codamuse/pandas that referenced this pull request Nov 12, 2022
* DEPR: date_range(closed)

* Disallow partial slicing of missing

* Review + failed test
mliu08 pushed a commit to mliu08/pandas that referenced this pull request Nov 27, 2022
* DEPR: date_range(closed)

* Disallow partial slicing of missing

* Review + failed test
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants