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

Fix bug where df.loc resulting in single row could give wrong index #11998

Merged
merged 2 commits into from
Oct 27, 2022

Conversation

eriknw
Copy link
Contributor

@eriknw eriknw commented Oct 25, 2022

Description

Fixes #11930

I can't figure out the purpose of these lines, so let's try removing them and run CI.

I haven't followed git blame back far enough to know the full story of these lines, but they originate at least three years ago:
https://github.com/rapidsai/cudf/pull/2208/files#diff-5f58cf9dfe537ce53c6481f690ba66ff10807da04ad82df1c79c6d112d19c08b

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@eriknw eriknw requested review from a team as code owners October 25, 2022 21:40
@github-actions github-actions bot added the Python Affects Python cuDF API. label Oct 25, 2022
@galipremsagar galipremsagar added bug Something isn't working non-breaking Non-breaking change labels Oct 25, 2022
@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Base: 87.40% // Head: 88.12% // Increases project coverage by +0.71% 🎉

Coverage data is based on head (0382688) compared to base (f72c4ce).
Patch has no changes to coverable lines.

❗ Current head 0382688 differs from pull request most recent head 7eb934d. Consider uploading reports for the commit 7eb934d to get more accurate results

Additional details and impacted files
@@               Coverage Diff                @@
##           branch-22.12   #11998      +/-   ##
================================================
+ Coverage         87.40%   88.12%   +0.71%     
================================================
  Files               133      133              
  Lines             21833    21991     +158     
================================================
+ Hits              19084    19380     +296     
+ Misses             2749     2611     -138     
Impacted Files Coverage Δ
python/strings_udf/strings_udf/__init__.py 84.31% <0.00%> (-12.57%) ⬇️
python/cudf/cudf/io/text.py 91.66% <0.00%> (-8.34%) ⬇️
python/cudf/cudf/core/_base_index.py 81.28% <0.00%> (-4.27%) ⬇️
python/strings_udf/strings_udf/_typing.py 94.73% <0.00%> (-1.06%) ⬇️
python/cudf/cudf/testing/dataset_generator.py 72.83% <0.00%> (-0.42%) ⬇️
python/dask_cudf/dask_cudf/backends.py 84.90% <0.00%> (-0.37%) ⬇️
python/dask_cudf/dask_cudf/core.py 73.92% <0.00%> (-0.21%) ⬇️
python/cudf/cudf/io/orc.py 92.94% <0.00%> (-0.09%) ⬇️
python/cudf/cudf/core/dataframe.py 93.74% <0.00%> (-0.03%) ⬇️
python/cudf/cudf/__init__.py 90.69% <0.00%> (ø)
... and 23 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eriknw
Copy link
Contributor Author

eriknw commented Oct 26, 2022

CI passes! That's nice.

The lines I am proposing to remove originated in #1622 by @shwina (this commit specifically: 04c4fc6). @shwina, any idea why these lines were added and what they're supposed to do?

Recall that I encountered this bug when trying to do joins or merges by index on two dask_cudf dataframes, which use repartition, which uses loc. This affects many "normal" joins in my tests (on tiny data). In other words, I think this is important to fix.

Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can delete some more code here...

python/cudf/cudf/core/dataframe.py Outdated Show resolved Hide resolved
@shwina
Copy link
Contributor

shwina commented Oct 26, 2022

@shwina, any idea why these lines were added and what they're supposed to do?

Alas, I have not. Happy to see code go away though!

Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@galipremsagar galipremsagar added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Oct 27, 2022
@galipremsagar
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit f17ea94 into rapidsai:branch-22.12 Oct 27, 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 bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] ddf.repartition adds extra row; df.loc on single row uses wrong index
4 participants