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

Add default= kwarg to .list.get() accessor method #10547

Merged
merged 13 commits into from Apr 6, 2022

Conversation

shwina
Copy link
Contributor

@shwina shwina commented Mar 30, 2022

Closes #10540.

As mentioned in the issue, this is a breaking change, although we could introduce this change in a non-breaking way by using a sentinel value for the kwarg if desired.

@shwina shwina requested a review from a team as a code owner March 30, 2022 20:53
@shwina shwina added the breaking Breaking change label Mar 30, 2022
@github-actions github-actions bot added the cuDF (Python) Affects Python cuDF API. label Mar 30, 2022
@shwina shwina added this to PR-WIP in v22.06 Release via automation Mar 30, 2022
@shwina shwina added feature request New feature or request and removed cuDF (Python) Affects Python cuDF API. labels Mar 30, 2022
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Some suggestions for improving docs/tests. This seems fine to make as a breaking change.

python/cudf/cudf/core/column/lists.py Show resolved Hide resolved
python/cudf/cudf/tests/test_list.py Show resolved Hide resolved
v22.06 Release automation moved this from PR-WIP to PR-Needs review Mar 30, 2022
@github-actions github-actions bot added the cuDF (Python) Affects Python cuDF API. label Mar 30, 2022
@shwina shwina requested a review from a team as a code owner March 31, 2022 11:54
@codecov
Copy link

codecov bot commented Mar 31, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.06@62360cb). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 3ecdbdb differs from pull request most recent head e1b7c58. Consider uploading reports for the commit e1b7c58 to get more accurate results

@@               Coverage Diff               @@
##             branch-22.06   #10547   +/-   ##
===============================================
  Coverage                ?   86.34%           
===============================================
  Files                   ?      140           
  Lines                   ?    22303           
  Branches                ?        0           
===============================================
  Hits                    ?    19257           
  Misses                  ?     3046           
  Partials                ?        0           

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 62360cb...e1b7c58. Read the comment docs.

@shwina
Copy link
Contributor Author

shwina commented Mar 31, 2022

@bdice could you take another look? I realized I had a bug in my implementation - fixed in this commit.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

A few small suggestions / comments. Nearly ready to approve.

python/cudf/cudf/core/column/lists.py Show resolved Hide resolved
if not (default is None or default is cudf.NA):
# determine rows for which `index` is out-of-bounds
lengths = count_elements(self._column)
out_of_bounds_indexes = (-index > lengths) | (index >= lengths)
Copy link
Contributor

Choose a reason for hiding this comment

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

(Non-blocker) Do we have a grammatical rule on indexes vs indices? :)

Copy link
Contributor

@bdice bdice Apr 1, 2022

Choose a reason for hiding this comment

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

(Slightly more of a blocker, on further inspection) These aren't really indexes/indices - this is a boolean column, right? That might deserve a name like out_of_bounds_mask.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to out_of_bounds_mask.

Copy link
Contributor Author

@shwina shwina Apr 1, 2022

Choose a reason for hiding this comment

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

The change from using - to np.negative came from cherry-picking commits from the branch #10564 where I inadvertently made changes first locally. We're eventually going to have to keep that change anyway.

python/cudf/cudf/tests/test_list.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/column/lists.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'll review the follow-up PR soon.

@shwina
Copy link
Contributor Author

shwina commented Apr 4, 2022

@gpucibot merge

1 similar comment
@shwina
Copy link
Contributor Author

shwina commented Apr 6, 2022

@gpucibot merge

v22.06 Release automation moved this from PR-Needs review to PR-Reviewer approved Apr 6, 2022
@rapids-bot rapids-bot bot merged commit 261879f into rapidsai:branch-22.06 Apr 6, 2022
v22.06 Release automation moved this from PR-Reviewer approved to Done Apr 6, 2022
rapids-bot bot pushed a commit that referenced this pull request Apr 12, 2022
…10564)

Closes #10552.

Depends on #10547

Authors:
  - Ashwin Srinath (https://github.com/shwina)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Charles Blackmon-Luca (https://github.com/charlesbluca)

URL: #10564
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change cuDF (Python) Affects Python cuDF API. feature request New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[FEA] Provide a default= kwarg in Series.list.get()
4 participants