Make pylibcudf.Table.columns() return a tuple - #23040
Merged
Merged
Conversation
madsbk
force-pushed
the
table-columns-tuple
branch
2 times, most recently
from
June 30, 2026 12:22
78ad816 to
842a2ed
Compare
madsbk
force-pushed
the
table-columns-tuple
branch
from
June 30, 2026 12:22
842a2ed to
d732b63
Compare
madsbk
marked this pull request as ready for review
June 30, 2026 13:37
wence-
reviewed
Jun 30, 2026
📝 WalkthroughWalkthrough
Changespylibcudf API and downstream adoption
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Matt711
approved these changes
Jun 30, 2026
Matt711
left a comment
Member
There was a problem hiding this comment.
I also checked for uses throughout RAPIDS and didn't see any we needed to change outside cudf https://github.com/search?q=org%3Arapidsai+%22.columns%28%29%22&type=code&p=1
Contributor
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
pylibcudf.Table.columns()now returns atuple[Column, ...]instead of alist[Column], preventing callers from mutating the table's internal column collection through a borrowed reference.This aligns with the convention already used in cuDF, where
Frame._columnsandFrame._column_namesare exposed as tuples.Additionally, this simplifies handling zero-column tables: #22765.
This PR also adds
pylibcudf.Table.release(), which transfers ownership of the columns to the caller as a fresh mutablelist[Column]and empties the table (mirroring libcudf'stable::release()).Breaking change
This is a breaking change to the public
pylibcudf.Table.columns()return type. Pass-through into pylibcudf functions still works (those functions now accept anySequence), but callers that mutate the returned value must either copy it (list(table.columns())) or useTable.release().Also,
pylibcudf.io.types.TableWithMetadata.columnsdelegates toTable.columns(), so it now returns atuple[Column, ...]as well.