Skip to content

fix(tables): keep leading-zero codes as text when inferring CSV column types - #9754

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/csv-import-leading-zero
Nov 6, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/csv-import-leading-zero

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • CSV import inferred a column as number whenever every sampled value parsed with Number(), so ZIP codes, phone numbers, and SKUs like 02134 were stored as 2134 and the leading zero was lost for good
  • inferColumnType now treats a value with a leading zero followed by another digit as text; 0, 0.5, and -0.5 still infer as numbers
  • Covers new-table imports and new columns added during an append import (both use the same inference)

Type of Change

  • Bug fix

Testing

  • Regression test in lib/table/import.test.ts, shown red on the pre-fix code, green after
  • lib/table/import.test.ts + lib/table/import-runner.test.ts pass (47 tests)
  • biome on changed files; full type-check/audits left to CI

Checklist

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

@vercel

vercel Bot commented Nov 6, 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 Nov 6, 2026 8:36pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Keeps leading-zero CSV codes as text when choosing types for new tables and newly added columns.

  • CSV imports keep codes with leading zeros in text columns.

Reviews (1) · Last reviewed commit: "fix(tables): keep leading-zero codes as ..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit dc9798d into staging Nov 6, 2026
62 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/csv-import-leading-zero branch November 6, 2026 20:41

This branch was previously deployed

1 inactive deployment
Preview — 16bd9c7d Deployed Nov 6, 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