Skip to content

fix(table-core): support numeric accessor keys#6434

Merged
KevinVandy merged 1 commit into
betafrom
agent/fix-4815-numeric-accessor-key
Jul 17, 2026
Merged

fix(table-core): support numeric accessor keys#6434
KevinVandy merged 1 commit into
betafrom
agent/fix-4815-numeric-accessor-key

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Jul 17, 2026

Copy link
Copy Markdown
Member

What changed

  • support numeric accessorKey values when constructing tuple/array columns
  • derive stable string column IDs while retaining the numeric key for row access
  • preserve numeric tuple value inference in DeepValue
  • keep worker aggregation column IDs consistent with normal column construction
  • add runtime and type-level regression coverage for tuple indices 0 and 1

Why

Numeric tuple accessors are accepted by the public types and documented usage, but column construction treated index 0 as absent and called string methods on other numeric indices. This caused valid array-index columns either to lack an ID/accessor or to throw.

Validation

  • all @tanstack/table-core tests: 52 files, 1,002 tests passed
  • TypeScript source and declaration-emit checks passed
  • Prettier check passed
  • git diff --check passed

Closes #4815

Summary by CodeRabbit

  • New Features

    • Added support for numeric accessor keys, including tuple-based row data.
    • Column identifiers are now generated correctly from numeric and other defined accessor keys.
    • Improved type support for accessing properties through non-string keys.
  • Bug Fixes

    • Corrected handling of falsy accessor keys such as 0 and empty strings.
    • Improved deep property access and aggregation column identifier generation.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4817a4b0-5e23-4c66-a872-3e5a3c8b8bb6

📥 Commits

Reviewing files that changed from the base of the PR and between a4040a2 and 8502850.

📒 Files selected for processing (5)
  • packages/table-core/src/core/columns/constructColumn.ts
  • packages/table-core/src/types/ColumnDef.ts
  • packages/table-core/src/types/type-utils.ts
  • packages/table-core/src/worker/initTableWorker.ts
  • packages/table-core/tests/unit/helpers/columnHelper.test.ts

📝 Walkthrough

Walkthrough

Numeric accessorKey values are now supported through updated type definitions, deep-value inference, column construction, and worker ID derivation. Tests cover tuple row access, generated string IDs, resolved values, and inferred cell types.

Changes

Numeric accessor key support

Layer / File(s) Summary
Accessor key contracts and runtime handling
packages/table-core/src/types/ColumnDef.ts, packages/table-core/src/types/type-utils.ts, packages/table-core/src/core/columns/constructColumn.ts, packages/table-core/src/worker/initTableWorker.ts
Accessor keys accept keyof TData; deep-value indexing supports those keys; column and aggregation IDs handle defined non-string or falsy keys.
Tuple accessor validation
packages/table-core/tests/unit/helpers/columnHelper.test.ts
Tests verify numeric tuple indices produce string IDs, resolve row values, and preserve inferred cell types.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: support for numeric accessor keys in table-core.
Linked Issues check ✅ Passed The changes address #4815 by supporting numeric accessorKey values, preserving tuple access, and adding regression tests.
Out of Scope Changes check ✅ Passed All code and test changes are directly related to numeric accessorKey support and its type/runtime handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-4815-numeric-accessor-key

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 17, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 8502850

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 7m 44s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 54s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-17 20:28:43 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown
More templates

@tanstack/alpine-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/alpine-table@6434

@tanstack/angular-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6434

@tanstack/angular-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table-devtools@6434

@tanstack/ember-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/ember-table@6434

@tanstack/lit-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6434

@tanstack/match-sorter-utils

npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6434

@tanstack/preact-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6434

@tanstack/preact-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6434

@tanstack/react-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6434

@tanstack/react-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6434

@tanstack/solid-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6434

@tanstack/solid-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6434

@tanstack/svelte-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6434

@tanstack/table-core

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6434

@tanstack/table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6434

@tanstack/vue-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6434

@tanstack/vue-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6434

commit: 8502850

@KevinVandy
KevinVandy marked this pull request as ready for review July 17, 2026 21:56
@KevinVandy
KevinVandy merged commit 9e92697 into beta Jul 17, 2026
9 checks passed
@KevinVandy
KevinVandy deleted the agent/fix-4815-numeric-accessor-key branch July 17, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Array index as an accessorKey in ColumnDef does not work

1 participant