Skip to content

[Repo Assist] Fix Frame.GetRowKeyAt to take int instead of int64 (issue #523)#588

Merged
dsyme merged 6 commits intomasterfrom
repo-assist/fix-getrowkeyat-int-consistency-05f07c2e357f7c7d
Mar 9, 2026
Merged

[Repo Assist] Fix Frame.GetRowKeyAt to take int instead of int64 (issue #523)#588
dsyme merged 6 commits intomasterfrom
repo-assist/fix-getrowkeyat-int-consistency-05f07c2e357f7c7d

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Mar 8, 2026

🤖 This is an automated PR from Repo Assist.

Fixes the API inconsistency reported in #523.

Problem

Frame.GetRowKeyAt(index) inferred index as int64 because IIndex.AddressAt takes int64. However:

  • The XML documentation says "Offset (integer) of the row key to be returned" — i.e. int
  • Frame.GetRowAt<'T>(index) uses an explicit int parameter with int64 index cast
  • Series.GetKeyAt(index) uses int

This means anyone calling frame.GetRowKeyAt(someIntVariable) would get a compile error unless they added an explicit int64 cast, which is surprising and inconsistent.

Fix

Add an explicit int type annotation to the parameter and a int64 index cast when calling AddressAt, matching the existing pattern in GetRowAt<'T>:

// Before (index inferred as int64)
member frame.GetRowKeyAt(index) =
  frame.RowIndex.KeyAt(frame.RowIndex.AddressAt index)

// After (index explicitly int, consistent with Series.GetKeyAt and Frame.GetRowAt)
member frame.GetRowKeyAt(index: int) =
  frame.RowIndex.KeyAt(frame.RowIndex.AddressAt(int64 index))

Breaking Change

⚠️ Minor breaking change: callers that explicitly pass int64 values (e.g. frame.GetRowKeyAt(0L) or frame.GetRowKeyAt(someInt64Var)) will need to add an explicit cast: frame.GetRowKeyAt(int someInt64Var). Callers passing plain int values (or integer literals like 42) 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)
  • ⚠️ Test suite execution: test project targets net5.0, not available in this environment. Tests will run in CI.

Closes #523

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@30f2254f2a7a944da1224df45d181a3f8faefd0d

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]>
@dsyme dsyme marked this pull request as ready for review March 9, 2026 04:09
@dsyme dsyme merged commit df8f037 into master Mar 9, 2026
2 checks passed
@dsyme dsyme deleted the repo-assist/fix-getrowkeyat-int-consistency-05f07c2e357f7c7d branch March 9, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

series.GetKeyAt and frame.GetRowKeyAt take different types for index. Seems inconsistent.

1 participant