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

Add column count validation #221

Merged
merged 2 commits into from
Jan 25, 2024
Merged

Add column count validation #221

merged 2 commits into from
Jan 25, 2024

Conversation

gpeng
Copy link
Contributor

@gpeng gpeng commented Jan 19, 2024

Context

Excel annoyingly drops the first column from a CSV export if the column has no entries. Testers have fallen foul of this and created records with the data in incorrect columns and validation messages are then a bit unhelpful.

Changes proposed in this pull request

Validate the column count in each row to enable us to provide a more helpful error message when this happens.

Checklist

  • Attach to Trello card
  • Rebased main
  • Cleaned commit history
  • Tested by running locally

@gpeng gpeng force-pushed the add-column-count-validation branch from dea6ced to 5189880 Compare January 19, 2024 16:48
@gpeng
Copy link
Contributor Author

gpeng commented Jan 19, 2024

@gpeng gpeng requested a review from malcolmbaig January 23, 2024 13:39
gpeng added 2 commits January 25, 2024 09:42
When creating a ChildrensBarredListEntry from a CSV row we want to
validate that the row has the correct number of columns to avoid the
data being incorrectly populated, particularly when Excel unhelpfully
removes the first column if it has no values i.e. none of the rows have
TRNs which is common.

Add a source_column_count parameter that can be passed when we want to
validate.L
As we create a ChildrensBarredListEntry from each CSV row we want to
check that the row has the correct number of columns to avoid errors
where the data is a column out if the CSV has been incorrectly created.

Pass the row column count with the params.
@gpeng gpeng force-pushed the add-column-count-validation branch from 5189880 to b4881f1 Compare January 25, 2024 09:43
@gpeng gpeng merged commit f407d64 into main Jan 25, 2024
11 checks passed
@gpeng gpeng deleted the add-column-count-validation branch January 25, 2024 09:49
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.

2 participants