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] off-by-one errors in cudf.date_range #12133

Closed
wence- opened this issue Nov 11, 2022 · 0 comments · Fixed by #16277
Closed

[BUG] off-by-one errors in cudf.date_range #12133

wence- opened this issue Nov 11, 2022 · 0 comments · Fixed by #16277
Assignees
Labels
1 - On Deck To be worked on next bug Something isn't working Python Affects Python cuDF API.

Comments

@wence-
Copy link
Contributor

wence- commented Nov 11, 2022

Describe the bug

[As part of attempting to get to XPASS-zero in the test suite]

If the date range is long enough, and for some frequencies, cudf.date_range has a fencepost error in the number of dates it produces.

Steps/Code to reproduce bug

import cudf
import pandas as pd
start = "1831-05-08 15:23:21"
end = "1996-11-21 04:05:30"
freq = "110546789L"

cr = cudf.date_range(start=start, end=end, freq=freq)
pr = pd.date_range(start=start, end=end, freq=freq)

assert len(cr) == len(pr) # => False, len(cr) == len(pr) + 1
print(cr[-1])
# => 1996-11-21T14:14:21.984000000
# Which is _after_ the specified end

Expected behavior

No fencepost error.

@wence- wence- added bug Something isn't working Needs Triage Need team to review and classify Python Affects Python cuDF API. labels Nov 11, 2022
@wence- wence- self-assigned this Nov 11, 2022
@GregoryKimball GregoryKimball added 1 - On Deck To be worked on next and removed Needs Triage Need team to review and classify labels Nov 19, 2022
@wence- wence- mentioned this issue Dec 6, 2022
3 tasks
rapids-bot bot pushed a commit that referenced this issue Jul 16, 2024
There are some cupy usages that don't seem _strictly_ necessary (generating starting data, array type conversion) in some APIs. IMO we should prefer using CPU data/the existing data structure/Column ops over cupy when possible

closes #12133

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #16277
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - On Deck To be worked on next bug Something isn't working Python Affects Python cuDF API.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants