fix(csv): preserve semicolon schema for header-only exports - #18
Merged
Merged
Conversation
The header-only fallback added for issue #15 hardcoded semicolon as the separator when csv.Sniffer can't establish one from a single line. But Wordstat also exports tab-delimited views (see "Fix the CSV sniffer's tab delimiter"), so a tab-delimited header-only export still collapsed into one column with embedded tabs — the exact silent-schema-corruption bug issue #15 was filed about, reproduced for the tab case. - choose the fallback delimiter by counting ';' vs '\t' occurrences in the header line instead of hardcoding ';' - extend the unparsed-delimiter header guard to reject both ';' and '\t' - add regression tests for the tab-delimited header-only case and for the guard rejecting an unparsed tab - bring CLAUDE.md's csv_io.py section in line with the actual encoding (UTF-8 with BOM, cp1251 as fallback) and line terminator (lone CR, normalized by Path.read_text's universal newlines) per issue #15 item 3
Owner
Author
🔍 Local review (cycle 1) — round 9f7ebcb2-1193-40af-a64f-df62499e1f96Reviewed locally (
Result: both reviewers approved — no FIX/SKIP findings this round. |
Owner
Author
📋 Review summary — all cycles
Totals: 0 FIX, 0 SKIP, 0 UNVERIFIED. Both configured reviewers ( |
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
Fixes #15
Tests
uv run pytest -q(116 passed)uv run ruff check .(All checks passed)git diff --checkPR opened for review; not merged.