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: is_all_dates #36697

Merged
merged 9 commits into from
Sep 30, 2020
Merged

DEPR: is_all_dates #36697

merged 9 commits into from
Sep 30, 2020

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel added the Deprecate Functionality to remove in pandas label Sep 29, 2020
@jreback jreback added this to the 1.2 milestone Sep 30, 2020
@jreback jreback added the Datetime Datetime data dtype label Sep 30, 2020
@jreback jreback merged commit 90a6135 into pandas-dev:master Sep 30, 2020
@jreback
Copy link
Contributor

jreback commented Sep 30, 2020

thanks! very nice

@jbrockmendel jbrockmendel deleted the depr-is_all_dates branch September 30, 2020 02:42
.rolling(window=25, min_periods=minp)
.apply(f, raw=raw)
.shift(-12)
.reindex(series.index)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this case raising a warning?

Copy link
Member

Choose a reason for hiding this comment

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

ping

Copy link
Member Author

Choose a reason for hiding this comment

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

series.reindex(list(series.index) + s) has an object-dtype Index that can be cast to DatetimeIndex

Copy link
Member

Choose a reason for hiding this comment

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

@jbrockmendel Thanks for the follow-up.

Now, the user is not actively creating a Seriew with an object-dtype index themselves, but it is happening under the hood in the rolling apply.
So I am not sure the user should see this warning (and it's actually not a single warning, but a flood of warnings, one for each window ..). Or what is the recommended way in this case to get rid of the warning?

Copy link
Member Author

Choose a reason for hiding this comment

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

could suppress it inside roll_apply?

Copy link
Member

Choose a reason for hiding this comment

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

Possibly. The warning only shows with raw=False, so I suppose this comes from creating a Series for each window. We might also be able to avoid the warning altogether (without the need to suppress it) by modifying the series construction to be explicit about the index dtype?

Copy link
Member

Choose a reason for hiding this comment

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

IMO we should address this before the release

Copy link
Member

Choose a reason for hiding this comment

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

I opened #38182 for this

kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
simonjayhawkins added a commit to simonjayhawkins/pandas that referenced this pull request Dec 24, 2020
jreback pushed a commit that referenced this pull request Dec 25, 2020
…to DatetimeIndex in the Series constructor (23598)" (#38679)

* Revert "DEPR: is_all_dates (#36697)"

This reverts commit 90a6135.

* revert Deprecated casting an object-dtype index of ``datetime`` objects to :class:`.DatetimeIndex` in the :class:`Series` constructor (:issue:`23598`) only

* Revert "BUG: record warnings related to DatetimeIndex (#37193)"

This reverts commit 23c41bd.

* remove assert_produces_warning added in TST/REF: collect tests by method, some misplaced #37354
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
…to DatetimeIndex in the Series constructor (23598)" (pandas-dev#38679)

* Revert "DEPR: is_all_dates (pandas-dev#36697)"

This reverts commit 90a6135.

* revert Deprecated casting an object-dtype index of ``datetime`` objects to :class:`.DatetimeIndex` in the :class:`Series` constructor (:issue:`23598`) only

* Revert "BUG: record warnings related to DatetimeIndex (pandas-dev#37193)"

This reverts commit 23c41bd.

* remove assert_produces_warning added in TST/REF: collect tests by method, some misplaced pandas-dev#37354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: remove Index.is_all_dates? PERF: Deprecate casting of index of dates to DatetimeIndex
3 participants