Skip to content

fix(imports): read CSV formula cells as the text they display - #121

Merged
artem-broccoli merged 3 commits into
mainfrom
fix/formula-first-name-mapping
Oct 23, 2026
Merged

artem-broccoli merged 3 commits into
mainfrom
fix/formula-first-name-mapping

Conversation

@artem-broccoli

Copy link
Copy Markdown
Contributor

Summary

A staff CSV whose first-name cell holds formula text, such as =HYPERLINK("https://…/profiles/ines-varga","Ines"), lost the whole first-name column: review flagged every row as missing a first name, and only "Read the original file" recovered the names.

Root cause: the CSV reader kept formula text as the cell's value. The mapping question therefore showed the model a URL-shaped value, masked as =XXXXXXXXX("xxxxx://…","Xxxx"), in the first-name column, and the model reasonably answered that the column does not hold only first names. When the model did map the column, that row's first name was the formula text itself. The masked sample, the prompt and the answer checks were working as designed; Excel files were not affected, because a formula cell there reads its saved value.

Fix: when a staff CSV is read, a cell that starts with = becomes the text a spreadsheet would display, worked out from the text and never evaluated or fetched:

  • =HYPERLINK("link","label") reads as label (, or ; between arguments, any case, spaces allowed)
  • =HYPERLINK("link") reads as link
  • any other formula reads as blank, since its result can't be known without evaluating it

Excel cells stay exactly as the workbook reader returns them. The model still sees only masked values (Xxxx for the label), and formula text no longer reaches import records.

Testing

  • Live eval: a new case, formula-first-name, is an Acme Corp CSV whose first first-name cell is a HYPERLINK to an intranet profile.
    • Before the fix: the first-name column was left unmapped and every first name read null (3 of 3 runs).
    • After: it passes 3 of 3 runs, and no personal value reaches the model.
    • Public eval: 51/51 before, 52/52 after. Model cost and latency are unchanged.
  • Unit tests in staffFile.test.ts:
    • CSV HYPERLINK with a label, with one argument and with a space before its bracket, another formula, and a plain name.
    • An Excel formula whose saved value starts with = keeps that value.
  • Real import path: reproduced by uploading fictional Acme Corp CSV and Excel files through the upload and map-file use cases with the real model. The Excel file read Ines from the saved value before and after the fix.
  • Docker image: in the built API image, the staff-file reader returns Ines for both files, and blank for an Excel formula with no saved value.
  • Suites: pnpm check, all integration tests (562) and end-to-end tests (197) pass.

Release Notes:

  • Fixed: a staff CSV with a formula such as =HYPERLINK(…) in a name cell no longer leaves the name column unmapped; the cell reads as the text it displays, and formulas are never evaluated.

@artem-broccoli
artem-broccoli merged commit 25251e4 into main Oct 23, 2026
8 checks passed
@artem-broccoli
artem-broccoli deleted the fix/formula-first-name-mapping branch October 23, 2026 11:18
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