Conversation
…eries typed accessors — closes #218 Without this attribute, F# silently infers 'obj' when the row value type is not constrained by context, masking type errors at compile time. The attribute forces callers to write e.g. frame.GetRow<float>(key) rather than frame.GetRow(key), making the intent unambiguous. Changes: - Frame.fs: add [<RequiresExplicitTypeArguments>] to TryGetRow<'T>, GetRow<'T> (both overloads), TryGetRowObservation<'T> - Series.fs (ObjectSeries): add to As<'R>, TryAs<'R>, GetAs<'R> (both overloads), TryGetAs<'R> (both overloads) - FrameModule.fs: make getRow/lookupRow/tryLookupRow/tryLookupRowObservation inline so their 'T parameter is resolved at each call site without constraining the frame's 'R/'C parameters to obj - Frame.fs (tests): update one direct TryGetRow call to use TryGetRow<obj> Co-authored-by: Copilot <[email protected]>
9 tasks
dsyme
approved these changes
Mar 19, 2026
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.
🤖 Repo Assist — implementing the API safety improvement requested in #218.
Problem
frame.GetRow(key),objSeries.As(),objSeries.GetAs("col")and theirTryGet*variants have a type parameter that controls what type the returnedseries values will be. Without explicit type annotation, F# may silently infer
obj, producing a series that appears correct at a glance but is typed asSeries<_, obj>rather than the intendedSeries<_, float>(or whatever thecaller expected). This was agreed upon by
@tpetricekback in 2014 but wasnever implemented.
Solution
Add
[(RequiresExplicitTypeArguments)]to the affected members. Callers arenow required to write the type argument explicitly:
All 669 tests pass.
Deedle.Mathalso builds cleanly (usesrow.As(float)()which already had the explicit type argument).