Repository navigation
fix(imports): read CSV formula cells as the text they display - #121
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aslabel(,or;between arguments, any case, spaces allowed)=HYPERLINK("link")reads aslinkExcel cells stay exactly as the workbook reader returns them. The model still sees only masked values (
Xxxxfor the label), and formula text no longer reaches import records.Testing
formula-first-name, is an Acme Corp CSV whose first first-name cell is aHYPERLINKto an intranet profile.null(3 of 3 runs).staffFile.test.ts:HYPERLINKwith a label, with one argument and with a space before its bracket, another formula, and a plain name.=keeps that value.Inesfrom the saved value before and after the fix.Inesfor both files, and blank for an Excel formula with no saved value.pnpm check, all integration tests (562) and end-to-end tests (197) pass.Release Notes:
=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.