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: datetimelike.astype(int_other_than_i8) return requested dtype #45574

Merged

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Jan 23, 2022

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

xref #45034 this should be just non-controversial parts of that discussion cc @jorisvandenbossche

@jreback
Copy link
Contributor

jreback commented Jan 31, 2022

dont' we have an issue about this? e.g. can you add the xref to the top

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Looks good!

warnings.warn(
f"The behavior of .astype from {self.dtype} to {dtype} is "
"deprecated. In a future version, this astype will "
"raise if the conversion overflows.",
Copy link
Member

Choose a reason for hiding this comment

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

I would make this "if the conversion overflow" a bit clearer in that it does actually happen with the current values (so it's not a hypothetical "if")

Copy link
Member Author

Choose a reason for hiding this comment

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

How about "[...] raise if the conversion overflows, as it did in this case with negative int64 values."?

@jreback jreback added Deprecate Functionality to remove in pandas Datetime Datetime data dtype labels Feb 5, 2022
@jreback jreback added this to the 1.5 milestone Feb 5, 2022
@jorisvandenbossche jorisvandenbossche merged commit 68f763e into pandas-dev:main Feb 14, 2022
@jorisvandenbossche
Copy link
Member

Thanks!

@jbrockmendel jbrockmendel deleted the depr-astype-dtlike-inty branch February 14, 2022 16:31
This was referenced Jan 5, 2023
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.

4 participants