Skip to content

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

# TODO: no tests get here
other = ensure_td64ns(other)

# TODO: what to do with mismatched resos?
Copy link
Member

Choose a reason for hiding this comment

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

IMO I would raise and only allow this for matching resos

assert ts.to_period("D") == alt.to_period("D")

@pytest.mark.parametrize(
"td", [timedelta(days=4), Timedelta(days=4), np.timedelta64(4, "D")]
Copy link
Member

Choose a reason for hiding this comment

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

So in the future Timedelta with a non-nano reso will be tested separately to solidify ts._reso/td._reso semantics?

Copy link
Member Author

Choose a reason for hiding this comment

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

thats the idea, yes

@mroeschke mroeschke added this to the 1.5 milestone Jun 13, 2022
@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 Jun 13, 2022
@mroeschke mroeschke merged commit b74dc5c into pandas-dev:main Jun 13, 2022
@jbrockmendel jbrockmendel deleted the nano-addsub branch June 13, 2022 19:59
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
…7313)

* ENH: Timestamp +- timedeltalike scalar support non-nano

* catch and re-raise OverflowError
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.

2 participants