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] pack and unpack causing wrong behaviour with slices of struct columns. #8722

Closed
shaneding opened this issue Jul 13, 2021 · 3 comments
Closed
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@shaneding
Copy link
Contributor

Describe the bug
After fixing slicing from a struct column in #8719, tests inside test_pack.py are now failing due to pack and unpack not correctly dealing with struct column slices. This is likely an issue with offset (same reason as what was causing the old error with slicing).

Steps/Code to reproduce bug

In [37]: import cudf

In [38]: df = cudf.DataFrame()

In [39]: df['a'] = cudf.Series([{'a': i} for i in range(5)])

In [40]: df
Out[40]: 
          a
0  {'a': 0}
1  {'a': 1}
2  {'a': 2}
3  {'a': 3}
4  {'a': 4}

In [41]: df[2:]
Out[41]: 
          a
2  {'a': 2}
3  {'a': 3}
4  {'a': 4}

In [42]: from cudf._lib.copying import pack, unpack

In [43]: packed = pack(df[2:])

In [44]: unpacked = cudf.DataFrame._from_table(unpack(packed))

In [45]: unpacked
Out[45]: 
          a
2  {'a': 0}
3  {'a': 1}
4  {'a': 2}

Expected behavior
Line 45 should output the same as line 41

Additional context
In the current version of cudf, line 41 will output the same result as line 45, which will cause this test to pass, however that is incorrect behaviour as the slice is not correct. #8719 will fix this slicing issue, however it will not pass the CI as a result of this test case. We may need to ignore test_pack.py until #8719 is merged then address this pack and unpack issue in a later PR, or address it altogether in #8719.

@shaneding shaneding added bug Something isn't working Needs Triage Need team to review and classify labels Jul 13, 2021
@shaneding shaneding added Python Affects Python cuDF API. Cython labels Jul 13, 2021
@beckernick beckernick removed the Needs Triage Need team to review and classify label Jul 19, 2021
@quasiben
Copy link
Member

@charlesbluca is this something you can look at ?

@shaneding
Copy link
Contributor Author

@quasiben This has been resolved via #8739. I will close the issue.

@quasiben
Copy link
Member

Ah, great! I've been slowly going through the my backlog and came across this one -- I'll see your PR in a few more clicks

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

3 participants