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] Compute memory_usage for list<struct<list>> #14122

Closed
GregoryKimball opened this issue Sep 18, 2023 · 0 comments
Closed

[BUG] Compute memory_usage for list<struct<list>> #14122

GregoryKimball opened this issue Sep 18, 2023 · 0 comments
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@GregoryKimball
Copy link
Contributor

Describe the bug
I would like to use the df.memory_usage API with nested types in cuDF-python. The API works great with deeply nested lists and structs, but with mixed nesting as in list<struct<list>>, the API throws an exception.

Steps/Code to reproduce bug

# create column typed as "list<struct<'b':list<int>>>"
df = cudf.DataFrame({
    'a': [[{'b':[1]}]]
})
print(df.memory_usage(deep=True).sum())
Traceback (most recent call last):
...
  File "/opt/conda/envs/all_cuda-120_arch-x86_64/lib/python3.10/site-packages/cudf/core/dtypes.py", line 665, in itemsize
    return sum(
  File "/opt/conda/envs/all_cuda-120_arch-x86_64/lib/python3.10/site-packages/cudf/core/dtypes.py", line 666, in <genexpr>
    cudf.utils.dtypes.cudf_dtype_from_pa_type(field.type).itemsize
AttributeError: 'ListDtype' object has no attribute 'itemsize'

Expected behavior
I would expect the memory_usage function called with deep=True to work on any cuDF type.

Environment details
Docker container based on rapidsai/ci:cuda12.0.1-ubuntu22.04-py3.10, running on A100 DGX, built from source on commit e1f6c7cb3fa62 (~23.10)

@GregoryKimball GregoryKimball added bug Something isn't working Needs Triage Need team to review and classify Python Affects Python cuDF API. labels Sep 18, 2023
@galipremsagar galipremsagar self-assigned this Sep 19, 2023
@galipremsagar galipremsagar removed the Needs Triage Need team to review and classify label Sep 19, 2023
@rapids-bot rapids-bot bot closed this as completed Oct 30, 2023
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

No branches or pull requests

2 participants