Conversation
Adds two non-mutating module-level functions to FrameModule.fs to address the long-standing issue #62: - Frame.renameCol oldKey newKey: renames a single column by matching the old key; if the key is not found, the frame is returned unchanged. - Frame.renameColsUsing mapping: renames all columns by applying a mapping function. Both functions follow the same pure construction pattern as Frame.indexColsWith (creating a new Frame directly without Clone+mutate). Four tests added; all 468 tests pass. Co-authored-by: Copilot <[email protected]>
This was referenced Mar 9, 2026
…3-09-cb8e9acddba72d03
dsyme
approved these changes
Mar 9, 2026
…3-09-cb8e9acddba72d03
Member
|
/repo-assist update the new xmldoc comments to be proper xml doc comments like the others |
…XML format Convert Markdown-style doc comments (## Parameters, [category:...]) to proper XML doc comment format (<summary>, <param>, <category>) consistent with the rest of FrameModule.fs. Co-authored-by: Copilot <[email protected]>
Contributor
Author
|
Commit pushed:
|
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.
🤖 This is an automated PR from Repo Assist.
Adds two non-mutating module-level functions to address the decade-old feature request in #62.
Root Cause / Motivation
df.RenameColumn(oldKey, newKey)anddf.RenameColumns(mapping)are only available as mutating members. There were no functional (pipe-friendly) module equivalents. This is an inconsistency with otherFramemodule functions likeaddCol,dropCol,replaceCol, andindexColsWith.Changes
Two new functions added to
FrameModule.fs:Both follow the same pure-construction pattern as
indexColsWith— creating a newFramedirectly without Clone+mutate — so no intermediate allocation is needed.Frame.renameCol oldKey newKeyoldKeyis not found, the frame is returned unchangedFrame.renameColsUsing mappingNote:
Frame.indexColsWithalready covers the case of replacing all column keys with a new sequence. The two new functions complement it by supporting single-column rename and function-based renaming.Test Status
✅ All 468 tests pass (
dotnet test tests/Deedle.Tests/Deedle.Tests.fsproj -c Release).4 new tests cover:
renameColsUsingtransforms all keysTrade-offs
renameColsUsingchanges the column key type (e.g.,string -> int), consistent withindexColsWith. This is intentional and matches the memberRenameColumns(mapping).renameColreturns the frame unchanged whenoldKeyis not found, matching the silent no-op behaviour of the underlying member.Closes #62