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]Select dtypes fails if list dtypes present in dataframe #6919

Closed
VibhuJawa opened this issue Dec 4, 2020 · 3 comments · Fixed by #8849
Closed

[BUG]Select dtypes fails if list dtypes present in dataframe #6919

VibhuJawa opened this issue Dec 4, 2020 · 3 comments · Fixed by #8849
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@VibhuJawa
Copy link
Member

Describe the bug
Select dtypes fails if list dtypes present in dataframe

Steps/Code to reproduce bug

import cudf
df = cudf.DataFrame({'int_col':[0,1,2],'list_col':[[1,2],[3,4],[5,6]]})
df.select_dtypes('int64').columns
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-1632dc06c94a> in <module>
      1 import cudf
      2 df = cudf.DataFrame({'int_col':[0,1,2],'list_col':[[1,2],[3,4],[5,6]]})
----> 3 df.select_dtypes('int64').columns

/nvme/0/vjawa/vjawa_cudf/cudf/python/cudf/cudf/core/dataframe.py in select_dtypes(self, include, exclude)
   6612                 if is_categorical_dtype(i_dtype):
   6613                     include_subtypes.add(i_dtype)
-> 6614                 elif issubclass(dtype.type, i_dtype):
   6615                     include_subtypes.add(dtype.type)
   6616 

TypeError: issubclass() arg 1 must be a class

Expected behavior
The behavior we get without list type

import cudf
df = cudf.DataFrame({'int_col':[0,1,2],'float_col':[1.1,2.2,3.3]})
df.select_dtypes('int64').columns
Index(['int_col'], dtype='object')

Environment overview (please complete the following information)

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

Environment details

cudf                      0.17.0a201203   cuda_10.2_py37_g5336301b85_372    rapidsai-nightly
libcudf                   0.17.0a201203   cuda10.2_g5336301b85_372    rapidsai-nightly
@VibhuJawa VibhuJawa added bug Something isn't working Needs Triage Need team to review and classify Python Affects Python cuDF API. and removed Needs Triage Need team to review and classify labels Dec 4, 2020
@github-actions
Copy link

This issue has been marked stale due to no recent activity in the past 30d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be marked rotten if there is no activity in the next 60d.

@github-actions github-actions bot added the stale label Feb 16, 2021
@github-actions
Copy link

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

rapids-bot bot pushed a commit that referenced this issue Jul 27, 2021
#8849)

Addresses bug #6919. `issubclass` expects a class, but a list is not a class, so we must add a check  before calling `issubclass` on it.

Authors:
  - Sarah Yurick (https://github.com/sarahyurick)

Approvers:
  - Ashwin Srinath (https://github.com/shwina)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #8849
@galipremsagar
Copy link
Contributor

Closed by #8849

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
4 participants