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] DType of Elements in Lists changes #10122

Closed
mlahir1 opened this issue Jan 25, 2022 · 0 comments · Fixed by #10151
Closed

[BUG] DType of Elements in Lists changes #10122

mlahir1 opened this issue Jan 25, 2022 · 0 comments · Fixed by #10151
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@mlahir1
Copy link

mlahir1 commented Jan 25, 2022

DType of Elements in Lists changes with df1['trans'] = df1['xyz']

Repro:

>>> import cudf
>>> df =cudf.DataFrame()
>>> df['unt_qty'] = [['a', 'b'], []]
>>> df['trans'] = [1, 2]
>>> df['xyz'] = [1121212,21231232]
>>> df1 = df[df.trans.isna()]
>>> df1['trans'] = df1['xyz']
>>> df1.unt_qty.dtype
ListDtype(object)

>>> df1 = df1.drop(['xyz'], axis=1)
>>> df1.unt_qty.dtype
ListDtype(int8)

if i comment out the line df1['trans'] = df1['xyz'] the dtype of list remains same.

>>> import cudf
>>> df =cudf.DataFrame()
>>> df['unt_qty'] = [['a', 'b'], []]
>>> df['trans'] = [1, 2]
>>> df['xyz'] = [1121212,21231232]
>>> df1 = df[df.trans.isna()]
>>> df1.unt_qty.dtype
ListDtype(object)

>>> df1 = df1.drop(['xyz'], axis=1)
>>> df1.unt_qty.dtype
ListDtype(object)

Impact: This causing issue in concats.

@mlahir1 mlahir1 added Needs Triage Need team to review and classify bug Something isn't working labels Jan 25, 2022
@beckernick beckernick added Python Affects Python cuDF API. and removed Needs Triage Need team to review and classify labels Jan 27, 2022
@galipremsagar galipremsagar self-assigned this Jan 27, 2022
rapids-bot bot pushed a commit that referenced this issue Jan 31, 2022
…lumn (#10151)

Fixes: #10122 

This PR fixes an issue where the list columns children[1]'s dtype wasn't being preserved correctly.

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

Approvers:
  - https://github.com/brandon-b-miller

URL: #10151
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.

3 participants