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] cudf.Series should accept None values when nan_as_null=False #15708

Closed
galipremsagar opened this issue May 9, 2024 · 0 comments · Fixed by #15709
Closed

[BUG] cudf.Series should accept None values when nan_as_null=False #15708

galipremsagar opened this issue May 9, 2024 · 0 comments · Fixed by #15709
Assignees
Labels
bug Something isn't working cudf.pandas Issues specific to cudf.pandas

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
When nan_as_null=False, we seem to raising an error saying there is mixed type of data:

Steps/Code to reproduce bug

In [1]: import cudf

In [2]: s = cudf.Series(["a", None])

In [3]: cudf.set_option("mode.pandas_compatible", True)

In [4]: ps = s.to_pandas()

In [5]: cudf.from_pandas(ps)
> /nvme/0/pgali/envs/cudfdev/lib/python3.11/site-packages/cudf/core/column/column.py(1958)as_column()
-> raise MixedTypeError(f"Cannot have NaN with {inferred_dtype}")

Expected behavior
We can error when we find string + nans but not when we find string + None's

@galipremsagar galipremsagar added bug Something isn't working cudf.pandas Issues specific to cudf.pandas labels May 9, 2024
@galipremsagar galipremsagar added this to the cudf.pandas API coverage milestone May 9, 2024
@galipremsagar galipremsagar self-assigned this May 9, 2024
rapids-bot bot pushed a commit that referenced this issue May 15, 2024
Fixes: #15708 

This PR fixes an issue where we were throwing an error when `None` is present and `nan_as_null=False`, this is a bug because of using `pd.isna`, this returns `True` for `nan`, `None` and `NA`. Whereas we are only looking for `np.nan` and not `None` and `pd.NA`

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

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

URL: #15709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cudf.pandas Issues specific to cudf.pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant