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] getitem on TimedeltaColumn returns None when there is a null value #13851

Closed
galipremsagar opened this issue Aug 11, 2023 · 0 comments · Fixed by #13853
Closed

[BUG] getitem on TimedeltaColumn returns None when there is a null value #13851

galipremsagar opened this issue Aug 11, 2023 · 0 comments · Fixed by #13853
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
Extracting a null value from TimedeltaColumn is returning None, it should be cudf.NA.

Steps/Code to reproduce bug

In [1]: import cudf

In [2]: s = cudf.Series([1, 2, 3, None], dtype='datetime64[ns]')

In [3]: s
Out[3]: 
0    1970-01-01 00:00:00.000000001
1    1970-01-01 00:00:00.000000002
2    1970-01-01 00:00:00.000000003
3                             <NA>
dtype: datetime64[ns]

In [4]: s[3]
Out[4]: <NA>

In [5]: s = cudf.Series([1, 2, 3, None], dtype='timedelta64[ns]')

In [6]: s
Out[6]: 
0    0 days 00:00:00.000000001
1    0 days 00:00:00.000000002
2    0 days 00:00:00.000000003
3                         <NA>
dtype: timedelta64[ns]

In [7]: s[3]

Expected behavior

In [7]: s[3]
Out[7]: <NA>

Environment overview (please complete the following information)

  • Environment location: [Bare-metal]
  • Method of cuDF install: [from source]

Environment details
Please run and paste the output of the cudf/print_env.sh script here, to gather any other relevant environment details

Additional context
Add any other context about the problem here.

@galipremsagar galipremsagar added bug Something isn't working Python Affects Python cuDF API. labels Aug 11, 2023
@galipremsagar galipremsagar self-assigned this Aug 11, 2023
rapids-bot bot pushed a commit that referenced this issue Aug 11, 2023
Fixes: #13851 

This PR fixes a mistake in `_get_np_scalar_from_timedelta64`, which has to return `cudf.NA` instead of `None`.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

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

URL: #13853
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant