Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selected header columns with no name #95

Merged
merged 5 commits into from
Dec 16, 2024
Merged

Conversation

rossjones
Copy link
Collaborator

@rossjones rossjones commented Oct 2, 2024

Currently when the call to GetHeaders encounters a cell with no value (e.g. a header with no text) then it fails to correctly extract header text.

This fixes the issue (and resolves #93) but the result is that we have excluded any selected header that has no text. We give this a default name [Untitled column n] where n is an incrementing number. This currently looks like

Import_spreadsheet_data_–_GOV_UK_Prototype_Kit

@rossjones rossjones requested review from alaric-rd and simonwo October 3, 2024 08:40
Whilst investigating whether the column index was carried through in the
sample (it isn't) ended up refactoring the function a little.
Copy link
Contributor

@alaric-rd alaric-rd left a comment

Choose a reason for hiding this comment

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

Maybe we would want to use spreadsheet-style absolute column references rather than a counter that goes up only on each unnamed column ("Column C" makes sense for .xls/.ods files; there's no particular convention for .csv so I suppose doing the same is best)? But quibbling over maybes like that in code reviews is foolish, this works so let's go with it and change it later if people complain!

@rossjones rossjones merged commit 1503e33 into main Dec 16, 2024
5 checks passed
@rossjones rossjones deleted the trailing-csv-columns branch December 16, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Blank trailing columns cause errors
2 participants