test(csv-import): add the dastardly CSV pathology corpus#159
Open
paddymul wants to merge 1 commit into
Open
Conversation
The CSV sibling of buckaroo's dastardly-dataframe dataset: one builder per pathological CSV (embedded newlines, BOM, non-UTF-8, decimal comma, mixed types past the infer window, ragged rows, NUL bytes, ambiguous dates, int overflow, tz-pinned naive timestamps, ...), each drawn from docs/research/csv-importers/edge-cases.md with the per-importer contrast in its docstring. test_dastardly_csv.py runs the corpus through tallyman_read_csv in three layers: - TestCorpusIsDeterministic — every case parses or raises a contract ValueError, never an unhandled exception or silent crash. - TestDocumentedBehavior — characterization guards pinning tallyman's current behavior pathology by pathology. - TestKnownGaps — xfail markers for the behavior the ADR/edge-cases.md want but tallyman does not yet implement (#142 ragged-short null-fill chief among them), ready-made red tests for the holistic edge-case pass. 47 passed, 3 xfailed against current main. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Adds the dastardly CSV dataset — the CSV sibling of buckaroo's dastardly-dataframe corpus. One builder per pathological CSV, run through
tallyman_read_csvto pin its behavior. Test-only; no production code changes.What's here
tests/dastardly_csv_library.py— 25 pathology builders, each returning raw CSV bytes (several cases live below the text layer: BOM, NUL, non-UTF-8). Every docstring names the hazard, how DuckDB/Polars/Pandas behave, and what tallyman wants. Cases and numbering trackdocs/research/csv-importers/edge-cases.md.tests/test_dastardly_csv.py— three layers:TestCorpusIsDeterministic— the corpus-level guard: every case reaches a deterministic outcome (a parsed schema, or aValueErrorcarrying thetallyman_read_csv:contract prefix), never an unhandled exception or silent crash.TestDocumentedBehavior— characterization/regression guards pinning tallyman's current behavior pathology by pathology (embedded newlines, BOM stripping, decimal comma, mixed-type escalation, leading zeros, duplicate headers, ragged-long, whitespace-flips-type, mixed newlines, ambiguous dates, tz-pinned naive timestamps, ...).TestKnownGaps—xfailmarkers for the behavior the ADR / edge-cases.md want but tallyman doesn't yet implement — ready-made red tests for the holistic edge-case pass (tallyman_read_csv: ragged/short CSV rows are silently null-filled instead of raising #142 ragged-short silent null-fill chief among them, plus NUL-as-structural-error and int-overflow-resolves).Verification
uv run pytest tests/test_dastardly_csv.py→ 47 passed, 3 xfailed against latestmain.ruff checkclean.🤖 Generated with Claude Code