Skip to content

fix(tables): keep integers past the safe range as text when inferring CSV column types - #10709

Open
kowshikdev wants to merge 1 commit into
simstudioai:stagingfrom
kowshikdev:fix/csv-import-unsafe-integers
Open

kowshikdev wants to merge 1 commit into
simstudioai:stagingfrom
kowshikdev:fix/csv-import-unsafe-integers

Conversation

@kowshikdev

Copy link
Copy Markdown

Summary

inferColumnType now treats an integer string beyond Number.MAX_SAFE_INTEGER as text, in the same way #9754 keeps leading-zero codes as text. Decimals and safe integers still infer as numbers. This covers type inference only; importing into an existing Number column behaves as before.

Fixes #10708

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

Regression test in lib/table/import.test.ts (before the fix the id column was inferred as number).

Also checked, with this change stacked on staging (0f6b0d4) together with my other independent fixes, on Windows:

  • The new tests fail with the source change reverted and pass with it.
  • bun run type-check: 33/33 packages pass.
  • biome check on the changed files: no findings.
  • check-block-registry.ts origin/staging passes, and bun run generate leaves the tree clean (skills:sync cannot run on this checkout, which has no symlinks).
  • bun run check:audits: the 12 audits that fail also fail on a clean staging checkout on this machine (mostly Windows path handling). No additional audit fails.

Not run: the full bun run test suite, the integration suites (no Docker here), or a live run of the app.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

N/A

🤖 Generated with Claude Code

… CSV column types

CSV import inferred a column as number whenever every sampled value
parsed with Number(). An integer above 2^53 (Discord or Twitter
snowflake ids, long account numbers) parses, but as a rounded double,
so 1234567890123456789 was stored as 1234567890123456800 and the
original digits were lost for good.

inferColumnType now treats an integer string that is not a safe integer
as text, the same way simstudioai#9754 keeps leading-zero codes as text. Decimals
and integers within the safe range still infer as numbers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Dec 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 3, 2026 2:35pm UTC

Request Review

This branch was previously deployed

1 inactive deployment
Preview — f225832b Deployed Dec 3, 2026 by vercel[bot]
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.

1 participant