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

Consolidate and improve reset_index #9750

Merged

Conversation

isVoid
Copy link
Contributor

@isVoid isVoid commented Nov 22, 2021

Partial of #9038

This is a rewrite of reset_index to share some common logics between Series and DataFrame. It extends it's capability to handle level argument for multi-level index, col_level and col_fill for multi-level column name support. And adds name argument support for series api.

@github-actions github-actions bot added the Python Affects Python cuDF API. label Nov 22, 2021
@isVoid isVoid added 2 - In Progress Currently a work in progress improvement Improvement / enhancement to an existing function Python Affects Python cuDF API. non-breaking Non-breaking change and removed Python Affects Python cuDF API. labels Nov 22, 2021
@isVoid isVoid changed the title Consolidate reset_index Consolidate and improve reset_index Nov 22, 2021
@isVoid isVoid marked this pull request as ready for review November 29, 2021 19:54
@isVoid isVoid requested a review from a team as a code owner November 29, 2021 19:54
python/cudf/cudf/core/dataframe.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/indexed_frame.py Show resolved Hide resolved
python/cudf/cudf/core/indexed_frame.py Show resolved Hide resolved
python/cudf/cudf/core/indexed_frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/indexed_frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/multiindex.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/indexed_frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/indexed_frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/series.py Show resolved Hide resolved
python/cudf/cudf/tests/test_series.py Outdated Show resolved Hide resolved
@isVoid isVoid requested a review from vyasr December 8, 2021 00:18
@vyasr
Copy link
Contributor

vyasr commented Dec 8, 2021

@isVoid at a glance, my best guess for why tests are failing now is this change on 5b81aa3. Specifically, the new _index_from_columns function is using len(columns) to determine the keys, but in this case that isn't quite right because you only want to use the first n_index_columns columns. If that's right, maybe just calling _index_from_columns(columns[:n_index_columns]) would fix it.

@codecov
Copy link

codecov bot commented Dec 11, 2021

Codecov Report

Merging #9750 (f7bf9d9) into branch-22.02 (967a333) will decrease coverage by 0.07%.
The diff coverage is n/a.

❗ Current head f7bf9d9 differs from pull request most recent head 1fb372c. Consider uploading reports for the commit 1fb372c to get more accurate results
Impacted file tree graph

@@               Coverage Diff                @@
##           branch-22.02    #9750      +/-   ##
================================================
- Coverage         10.49%   10.41%   -0.08%     
================================================
  Files               119      119              
  Lines             20305    20486     +181     
================================================
+ Hits               2130     2134       +4     
- Misses            18175    18352     +177     
Impacted Files Coverage Δ
python/dask_cudf/dask_cudf/sorting.py 92.30% <0.00%> (-0.61%) ⬇️
python/cudf/cudf/__init__.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/index.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/parquet.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/series.py 0.00% <0.00%> (ø)
python/cudf/cudf/utils/utils.py 0.00% <0.00%> (ø)
python/cudf/cudf/utils/dtypes.py 0.00% <0.00%> (ø)
python/cudf/cudf/utils/ioutils.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/dataframe.py 0.00% <0.00%> (ø)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eba4f03...1fb372c. Read the comment docs.

@isVoid isVoid added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Jan 5, 2022
@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Jan 6, 2022
@galipremsagar
Copy link
Contributor

@gpucibot merge

@galipremsagar
Copy link
Contributor

rerun tests

@isVoid
Copy link
Contributor Author

isVoid commented Jan 8, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 0722e20 into rapidsai:branch-22.02 Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants