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 implicitly converting object types to the actual types #14038

Closed
galipremsagar opened this issue Sep 6, 2023 · 0 comments · Fixed by #14050
Closed

[BUG] cudf implicitly converting object types to the actual types #14038

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

Comments

@galipremsagar
Copy link
Contributor

galipremsagar commented Sep 6, 2023

Describe the bug
Pandas allows object dtype that can contain values of arbitrary types, cudf is converting that column to the actual type of the values in it.

Steps/Code to reproduce bug

In [1]: import pandas as pd

In [2]: s = pd.Series([1, 2, 3], dtype='object')

In [3]: import cudf

In [4]: gs = cudf.from_pandas(s)

In [5]: gs
Out[5]: 
0    1
1    2
2    3
dtype: int64

In [6]: s.dtype
Out[6]: dtype('O')

In [7]: gs.dtype
Out[7]: dtype('int64')

Expected behavior
We shouldn't be allowing this behavior as we don't have a true object dtype.

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 Affects Python cuDF API. labels Sep 6, 2023
@galipremsagar galipremsagar self-assigned this Sep 6, 2023
rapids-bot bot pushed a commit that referenced this issue Sep 7, 2023
…ted (#14050)

Fixes #14038 

This PR introduces changes that raise an error when a column of `object` dtype is being constructed when the data is not string or bools.

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

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

URL: #14050
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