-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Disable Field count validation of CSV viewer #35228
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
base: main
Are you sure you want to change the base?
Conversation
Default behaviour rejected all rows (Records) with more or fewer columns (Fields) than the first row, preventing them from rendering at all and silently hiding them.
Unit tests need to be updated/extended:
|
I see that test case ( |
What will happen to CSV file comparisons after this change? |
Yeah, row-based diff would be similar to git diff and likely more readable. Probably better to split that out into another PR. |
Default behaviour rejected all rows (Records) with more or fewer columns (Fields) than the first row, preventing them from parsing at all and silently hiding them. While RFC4180 section 2.4 says each line should contain the same number of fields, enforcing this on the viewer is unhelpful.


This pull request disables that validation, allowing the viewer to render lines with fewer columns than the maximum number within the file. As it's a simple HTML table, this works without additional changes (i.e. no need to manually determine the maximum number of columns), but the default appearance of rows with fewer columns may be undesirable to some people, especially when using CSS that has
td {border-right: none}
.Fixes #16559, #30358.
Unfortunately, retaining empty lines is less trivial, so the line numbers on the leftmost column will still not match the source file whenever those are present, though a future PR could address that.