Conversation
Frame.GetRowKeyAt(index) was inferring 'index' as int64 because AddressAt takes int64. However: - The documentation says 'Offset (integer)' (meaning int) - Frame.GetRowAt<T>(index) uses explicit 'int' with a cast - Series.GetKeyAt(index) uses 'int' This was an API inconsistency: passing an int variable required an explicit int64 cast. Fix by annotating the parameter as 'int' and adding an explicit int64 cast when calling AddressAt, consistent with GetRowAt and Series.GetKeyAt. Note: this is a minor breaking change for callers that explicitly pass int64 values — they will need to cast to int. Co-authored-by: Copilot <[email protected]>
9 tasks
…y-05f07c2e357f7c7d
…y-05f07c2e357f7c7d
…y-05f07c2e357f7c7d
…y-05f07c2e357f7c7d
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.
Fixes the API inconsistency reported in #523.
Problem
Frame.GetRowKeyAt(index)inferredindexasint64becauseIIndex.AddressAttakesint64. However:intFrame.GetRowAt<'T>(index)uses an explicitintparameter withint64 indexcastSeries.GetKeyAt(index)usesintThis means anyone calling
frame.GetRowKeyAt(someIntVariable)would get a compile error unless they added an explicitint64cast, which is surprising and inconsistent.Fix
Add an explicit
inttype annotation to the parameter and aint64 indexcast when callingAddressAt, matching the existing pattern inGetRowAt<'T>:Breaking Change
int64values (e.g.frame.GetRowKeyAt(0L)orframe.GetRowKeyAt(someInt64Var)) will need to add an explicit cast:frame.GetRowKeyAt(int someInt64Var). Callers passing plainintvalues (or integer literals like42) will now work without any cast.Test Status
dotnet build src/Deedle/Deedle.fsproj— succeeded (0 errors, 2 pre-existing warnings)dotnet build tests/Deedle.Tests/Deedle.Tests.fsproj— succeeded (0 errors, no callers broken)net5.0, not available in this environment. Tests will run in CI.Closes #523