Repository navigation
Report empty CSV column names - #18
Merged
kushagarwal2910-lang merged 1 commit intoOct 12, 2026
Merged
kushagarwal2910-lang merged 1 commit into
kushagarwal2910-lang merged 1 commit into
Conversation
`inspect_csv` now returns `empty_header_indices`: the zero-based positions of
header cells that are empty or whitespace-only, so a blank column name is
visible instead of only its effect on the row shape.
The field is warning-only. `valid` stays true, the empty string stays in
`columns`, and the count never moves. The empty-input branch adds an empty
`empty_header_indices` list; a document that fails to parse keeps its current
`{"valid": false, "error": ...}` shape with no `empty_header_indices` key.
Fixes github-community-gitam#11.
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.
inspect_csvnow returnsempty_header_indices: the zero-based positions of header cells that are empty or whitespace-only, so a blank column name is visible instead of only its effect on the row shape.Every item on the issue's checklist:
inspect_csv("name,,age\nAda,20,x\nBob,30,y")["empty_header_indices"] == [1]— the issue's own example"name, ,age"→[1])validstaysTrue; a blank name is a warning, not an invalid documentcolumnskeeps the empty string unchangedrow_count,missing_valuesandinconsistent_rowsare unchangedempty_header_indiceslisttests/test_csv_tool_empty_header.py, runnable on its owndocs/tool-guide.mdupdated (the README does not list output keys, so it needed no change)A document that fails to parse keeps its current
{"valid": false, "error": ...}shape, with noempty_header_indiceskey — there are no header positions to name.What I ran:
python -m pytest -q→ 62 passed (55 before, 7 new),python -m pytest tests/test_csv_tool_empty_header.py -q→ 7 passed, and.github/scripts/check_rules.py→ passes.Closes #11.