Skip to content

BUG: DateOffset addition preserve non-nano #47334

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

Merged
merged 1 commit into from
Jun 13, 2022

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.

@@ -1140,7 +1141,9 @@ cdef class RelativeDeltaOffset(BaseOffset):

weeks = kwds.get("weeks", 0) * self.n
if weeks:
dt64other = dt64other + Timedelta(days=7 * weeks)
delta = Timedelta(days=7 * weeks)
td = (<_Timedelta>delta)._as_reso(reso)
Copy link
Member

Choose a reason for hiding this comment

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

In the future this cast isn't needed once _as_reso is public?

Copy link
Member Author

Choose a reason for hiding this comment

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

needed as long as it is cdef instead of cpdef

@mroeschke mroeschke added the Numeric Operations Arithmetic, Comparison, and Logical operations label Jun 13, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jun 13, 2022
@mroeschke mroeschke added Frequency DateOffsets Non-Nano datetime64/timedelta64 with non-nanosecond resolution labels Jun 13, 2022
@mroeschke mroeschke merged commit 8de88ff into pandas-dev:main Jun 13, 2022
@jbrockmendel jbrockmendel deleted the nano-apply_array branch June 13, 2022 19:30
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frequency DateOffsets Non-Nano datetime64/timedelta64 with non-nanosecond resolution Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants