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: astype dt64<->dt64tz #39258

Merged
merged 8 commits into from
Jan 21, 2021
Merged

Conversation

jbrockmendel
Copy link
Member

@jreback jreback added Deprecate Functionality to remove in pandas Datetime Datetime data dtype labels Jan 20, 2021
doc/source/user_guide/timeseries.rst Show resolved Hide resolved
pandas/core/dtypes/cast.py Outdated Show resolved Hide resolved
pandas/core/dtypes/cast.py Outdated Show resolved Hide resolved
@@ -942,6 +942,32 @@ def coerce_indexer_dtype(indexer, categories):
return ensure_int64(indexer)


def _find_level() -> int:
"""
Find the appropriate stacklevel with which to issue a warning for astype.
Copy link
Contributor

Choose a reason for hiding this comment

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

i would move this elsewhere, maybe to pandas.util._validation (or similar).

maybe just pass the names in as needed e.g. L958 (or hard-code ok too)

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe util._exceptions?

Copy link
Contributor

Choose a reason for hiding this comment

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

sure

Copy link
Member Author

Choose a reason for hiding this comment

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

updated + green

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

tested with DTI, Series, DTA? (i think so, just confirming). do we allow this with Timestamp? (obviously deprecate if we do)

@jbrockmendel
Copy link
Member Author

tested with DTI, Series, DTA? (i think so, just confirming).

Yes

do we allow this with Timestamp? (obviously deprecate if we do)

No, there is no Timestamp.astype

@jreback jreback merged commit f958cf5 into pandas-dev:master Jan 21, 2021
@jreback
Copy link
Contributor

jreback commented Jan 21, 2021

great

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.

BUG: dt64 <-> dt64tz roundup
2 participants