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] Name of Columns being Shifted when Written #10010

Closed
mlahir1 opened this issue Jan 11, 2022 · 2 comments · Fixed by #10170
Closed

[BUG] Name of Columns being Shifted when Written #10010

mlahir1 opened this issue Jan 11, 2022 · 2 comments · Fixed by #10170
Assignees
Labels
bug Something isn't working cuIO cuIO issue Python Affects Python cuDF API.

Comments

@mlahir1
Copy link

mlahir1 commented Jan 11, 2022

Name of Columns being Shifted when Written as first col becomes __index_level_0__ and rest of the columns are shifted by 1.

Repro code:

>>> df= cudf.DataFrame()
>>> for c in range(10):
...   df[f'_col{c}'] = range(10)
... 
>>> df = df[df._col1.isin([0,1,2,3])]
>>> df
   _col0  _col1  _col2  _col3  _col4  _col5  _col6  _col7  _col8  _col9
0      0      0      0      0      0      0      0      0      0      0
1      1      1      1      1      1      1      1      1      1      1
2      2      2      2      2      2      2      2      2      2      2
3      3      3      3      3      3      3      3      3      3      3
>>> df.to_orc('test.orc')
>>> cudf.read_orc('test.orc')
   __index_level_0__  _col0  _col1  _col2  _col3  _col4  _col5  _col6  _col7  _col8
0                  0      0      0      0      0      0      0      0      0      0
1                  1      1      1      1      1      1      1      1      1      1
2                  2      2      2      2      2      2      2      2      2      2
3                  3      3      3      3      3      3      3      3      3      3
>>> df.to_orc('test.orc', use_index=False)
>>> cudf.read_orc('test.orc')
   __index_level_0__  _col0  _col1  _col2  _col3  _col4  _col5  _col6  _col7  _col8
0                  0      0      0      0      0      0      0      0      0      0
1                  1      1      1      1      1      1      1      1      1      1
2                  2      2      2      2      2      2      2      2      2      2
3                  3      3      3      3      3      3      3      3      3      3
@mlahir1 mlahir1 added Needs Triage Need team to review and classify bug Something isn't working labels Jan 11, 2022
@mlahir1
Copy link
Author

mlahir1 commented Jan 11, 2022

df = df.reset_index().drop(columns=['index']) before to_orc, get around the issue.

@harrism harrism added the Python Affects Python cuDF API. label Jan 11, 2022
@galipremsagar galipremsagar self-assigned this Jan 14, 2022
@galipremsagar galipremsagar added cuIO cuIO issue and removed Needs Triage Need team to review and classify labels Jan 14, 2022
@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 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. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

rapids-bot bot pushed a commit that referenced this issue Feb 24, 2022
Fixes: #10010 

This PR:

- [x] Fixes `to_orc` by enabling writing of dataframe metadata to ORC file being created.
- [x] Fixes `read_orc` to correctly read and assign `Index` objects that exist in `metadata`
- [x] Note: This change is not backward compatible with files already written in previous versions of `cudf`.

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

Approvers:
  - Ram (Ramakrishna Prabhu) (https://github.com/rgsl888prabhu)

URL: #10170
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cuIO cuIO issue Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants