Conversation
Implements the frame-comparison part of #9. Given two frames, Frame.compare returns a new frame where each cell is a Diff<obj> describing whether the value was unchanged (omitted), changed (Change), removed (Remove), or added (Add) relative to the first frame. - Columns present only in frame1 yield Diff.Remove values - Columns present only in frame2 yield Diff.Add values - Columns present in both are compared element-wise via Series.compare Series.compare already existed; this adds the Frame-level counterpart. Co-authored-by: Copilot <[email protected]>
Closed
9 tasks
Member
|
/repo-assist add some testing that is not type Diff, we need to check the strong typing works |
…parisons Add tests that use explicit type annotations (Series<int, Diff<float>>, Series<string, Diff<string>>, Series<string, Diff<int>>) to verify Series.compare and Series.Compare are strongly typed — not Diff<obj>. Also add Frame column strong-typing tests using Series.compare on typed columns extracted from frames. 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 PR was created by Repo Assist in response to a
/repo-assistcommand from @dsyme.Closes #9.
What
Adds
Frame.compare— the frame-level counterpart to the already-existingSeries.compare. Given two frames,Frame.comparereturns a newFrame<'R, 'C>where each cell is aDiff(obj)describing the change between the two frames.Approach
Frame.comparewas never implemented, even thoughSeries.compareand theDiff<'T>type have existed for a while.FrameModule.fs, iterate over the union of both frames' column keys, retrieve each column asSeries<'R, obj>(usingTryGetColumn(obj)— columns missing from one frame yieldSeries.empty), then delegate per-column comparison to the existingSeries.compare/series.Compare(). The result columns are collected into a new frame viaFrameUtils.fromColumns.Framemember? AddingComparedirectly to theFrame<'R,'C>type body (which uses F#'s mutually-recursiveandwithFrameUtils) caused type-inference issues that constrainedFrameUtils.fromColumnstoobj, breaking unrelated code. Implementing it as a standalone function inFrameModule.fsavoids this entirely, consistent with howstrConcatandzipare structured.Test status
All 615 existing tests pass. Three new tests cover:
Change,Remove, andAddvalues in shared columns