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] Assigning incompatible NA types to a column is leading to implicit conversions #14218

Closed
galipremsagar opened this issue Sep 27, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
When we try assigning cudf.NaT to non datetime/timedelta types, we are implicitly type-casting to cudf.NA. Pandas actually assign object dtype or raises incase of nullable dtypes.

Steps/Code to reproduce bug

In [19]: import cudf

In [20]: import pandas as pd

In [21]: s = pd.Series([1, 2, 3])

In [22]: s
Out[22]: 
0    1
1    2
2    3
dtype: int64

In [26]: s[1] = pd.NaT

In [27]: s
Out[27]: 
0      1
1    NaT
2      3
dtype: object

In [28]: s = cudf.Series([1, 2, 3])

In [29]: s
Out[29]: 
0    1
1    2
2    3
dtype: int64

In [30]: s[1] = cudf.NaT

In [31]: s
Out[31]: 
0       1
1    <NA>
2       3
dtype: int64

Expected behavior
Raise an error.

Environment overview (please complete the following information)

  • Environment location: [Bare-metal]
  • Method of cuDF install: [from source]
@galipremsagar galipremsagar added bug Something isn't working python labels Sep 27, 2023
@galipremsagar galipremsagar self-assigned this Sep 27, 2023
@mroeschke
Copy link
Contributor

In 3.0, In [26]: will be disallowed (the user will need to cast the Series to the correct scalar type before assigning to avoid object)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants