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

BUG: BusinessDay addition with non-nano #55608

Merged
merged 5 commits into from
Oct 25, 2023

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Oct 20, 2023

  • 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.

res = res.view(dtarr.dtype) + Timedelta(self.offset)
res = res.view(dtarr.dtype) + Timedelta(self.offset).as_unit("s")
Copy link
Member

Choose a reason for hiding this comment

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

i might be missing something, but wouldn't this regress if the offset contains sub seconds?

idx = pd.date_range("2010/02/01", "2010/02/10", freq="12h", unit='ns')
off = BDay(offset=pd.Timedelta(3, unit="ns"))
t1 = idx + off

Copy link
Member Author

Choose a reason for hiding this comment

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

dangit good catch, will update

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+greenish

@mroeschke mroeschke added Frequency DateOffsets Non-Nano datetime64/timedelta64 with non-nanosecond resolution labels Oct 20, 2023
@mroeschke mroeschke added this to the 2.2 milestone Oct 25, 2023
@mroeschke mroeschke merged commit 455b868 into pandas-dev:main Oct 25, 2023
33 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the bug-bday branch October 25, 2023 17:38
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants