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

Access self.index instead of self._index where possible #15781

Merged
merged 9 commits into from
May 22, 2024

Conversation

mroeschke
Copy link
Contributor

Description

Since index is defined as

@property
def index(self):
    return self._index

Get and set to self.index when possible. Setting to self.index ensures that we may not be creating an invalid IndexedFrame with a len(index) != len(columns).

There are times when still setting self._index was necessary because some data was being swapped "inplace" and validation needed to be avoided. (Hoping to avoid this pattern in the future)

Checklist

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

@mroeschke mroeschke added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 18, 2024
@mroeschke mroeschke requested a review from a team as a code owner May 18, 2024 00:49
@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 57444ed into rapidsai:branch-24.06 May 22, 2024
76 checks passed
@mroeschke mroeschke deleted the cln/_index branch May 22, 2024 20:04
@mroeschke mroeschke restored the cln/_index branch May 22, 2024 20:09
@mroeschke mroeschke deleted the cln/_index branch May 22, 2024 20:09
rapids-bot bot pushed a commit that referenced this pull request May 24, 2024
Triaging recent dask-cuda [breakage](https://github.com/rapidsai/dask-cuda/actions/runs/9202583065/attempts/1) led me to #15781, where it seems like the passing of an index object directly to the `IndexedFrame.index` setter (and therefore, wrapping of this index in an `Index()` constructor) has caused proxifying issues on dask-cuda's end.

cc @rjzamora @mroeschke

Authors:
  - Charles Blackmon-Luca (https://github.com/charlesbluca)
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)

URL: #15843
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants