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

API: Change DTA/TDA add/sub to match numpy #48748

Merged
merged 6 commits into from
Sep 28, 2022

Conversation

jbrockmendel
Copy link
Member

Sits on top of #48743

@mroeschke mroeschke added Datetime Datetime data dtype Numeric Operations Arithmetic, Comparison, and Logical operations Timedelta Timedelta data type Non-Nano datetime64/timedelta64 with non-nanosecond resolution labels Sep 26, 2022
@jbrockmendel
Copy link
Member Author

@mroeschke nothing really time-sensitive here, but this is a blocker for constructor stuff

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Could you also add a test where the ts + td could be downcast to a lower resolution but isn't?

e.g.

Timestamp(year=2022, month=1, day=1, microsecond=999999) + Timedelta(microseconds=1) remains micro?

@jbrockmendel
Copy link
Member Author

Added test_addition_doesnt_downcast_reso

@mroeschke
Copy link
Member

Added test_addition_doesnt_downcast_reso

Thanks. Just merged #48743 which I release was supposed to be the Timestamp/Timedelta change.

Could you add a similar dont downcast test for DTA/TDA?

@jbrockmendel
Copy link
Member Author

test added + green

@mroeschke mroeschke added this to the 1.6 milestone Sep 28, 2022
@mroeschke mroeschke merged commit 0dadc71 into pandas-dev:main Sep 28, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the nano-arith-2b branch September 28, 2022 15:43
@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
* API: Change Timestamp/Timedelta arithmetic to match numpy

* fix interval test

* DTA/TDA add/sub upcast instead of downcast

* test for no-downcasting

* add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Non-Nano datetime64/timedelta64 with non-nanosecond resolution Numeric Operations Arithmetic, Comparison, and Logical operations Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants