Skip to content

Profiler: zips of tables, CSV not in UTF-8, files that are not one table - #915

Merged
paulananth merged 4 commits into
mainfrom
claude/profiling-07-zip-csv
Oct 11, 2026
Merged

paulananth merged 4 commits into
mainfrom
claude/profiling-07-zip-csv

Conversation

@paulananth

Copy link
Copy Markdown
Owner

Profiler fixes for the gaps found on ticket 07's ADV bulk files: the data-profiling skill, its findings spec and ticket 07. No platform code.

The gaps. A zip of CSV tables was refused. One Windows-1252 member made DuckDB stop the whole run with "CSV Error on Line 3".

What changed.

  • Zips of tables. A zip of CSV or Parquet files gives each member as its own table, located at zip#member with its own sha256. Part names stay distinct when members or zips share a file name. Mac __MACOSX entries are left out.
  • Encoding. A CSV that is not UTF-8 is copied as UTF-8, from Windows-1252 if that reads it, else Latin-1. Its encoding record says it was inferred, gives the first byte that is not UTF-8, and gives declare, the read.encoding the reading contract should state: windows-1252, [utf-8, windows-1252], or none. UTF-16 files and files with NUL bytes are not read.
  • Shape. DuckDB reads leniently: a ragged file can load as one column, a preamble is skipped, and an open quote is kept as data. So each CSV is read again with Python's csv module. A file is not one table if it has a skipped preamble, a row with another field count, a quote that does not close, or one column whose first two lines hold another delimiter. Such a file is not read, and the reason gives the line as evidence.
  • Not stopping. A table that is not read is listed in dataset.not_read with its reason, and the rest of the input is profiled.

Decision (operator, 2026-10-11): option 1. The profiler stays self-contained, with DuckDB pulled in only for the run (plan decision 3). It works out an encoding and names the contract setting; the Rust engine does the real reading.

Cost. The checks read each CSV in full several times, sampled files included: about three times a plain read (88 MB, 2 million rows: 9.4 s against 3.0 s). SKILL.md says so.

Open on the ticket. Gap 3: is a custodian held only inside custody rows found as its own entity? Not verified. The ADV files are no longer on this machine, and #899's entity finder may not catch broker-dealer numbers of varying length or the 15% of rows that carry no identifier.

Checks.

  • 209 profiling tests pass, including the genericity lint.
  • GoF consult: leave it (register routes by format; this is one more branch).
  • Three-axis review, then a re-review of the fixes. Every finding is fixed, and the re-review found no false positive on 20 regular CSV shapes (multi-line quoted fields, TSV, semicolons, CRLF, CR-only line endings, a byte-order mark, no header, a sampled file).
  • Trial B was not rerun: its data set is no longer here, and its SQLite form does not use the CSV path.

🤖 Generated with Claude Code

Aneena Ananth and others added 4 commits October 11, 2026 17:15
…readable table

Found on ticket 07's ADV bulk files: a zip of CSV tables was refused, and one
Windows-1252 member stopped the whole run. A zip of CSV or Parquet files now
gives each member as its own file (location zip#member); a CSV that is not
UTF-8 is copied as UTF-8 from Windows-1252, else Latin-1, and its input says
`encoding`; a table DuckDB cannot read is listed in `dataset.not_read` with
its reason, and the rest is profiled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vidence

Standards: copies and part names of same-named members no longer collide, a
repeated member name no longer stops the run, no work path in a reason, a
member has its own checksum. Spec: DuckDB reads leniently, so each CSV is
read again with the standard library and one that is not one table is not
read; the encoding is marked inferred with the first byte that is not UTF-8;
UTF-16 and NUL bytes are not read; gap 3 is open, not claimed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…UTF-8

Operator, 2026-10-11: keep the profiler self-contained (option 1); its
findings say what the contract declares, and the engine reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, cost stated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paulananth
paulananth merged commit 8622e19 into main Oct 11, 2026
6 checks passed
@paulananth
paulananth deleted the claude/profiling-07-zip-csv branch October 11, 2026 21:30
paulananth added a commit that referenced this pull request Oct 11, 2026
Co-authored-by: Aneena Ananth <aneenaananth@MacBook-Air.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
paulananth pushed a commit that referenced this pull request Oct 14, 2026
- Ticket 01: the profiling gaps (#915, #923), the ownership source
  extracts (#951) and the capacity links (#952) are merged; ticked with
  their merge commits and ET times. Custody rows that stay "unknown" are
  deferred to 07b, the name_id cross-reference.
- mastering-to-done 26 done (#956).
- mastering-to-done 27, the code names, moves into the priority map as
  ticket 73; the old path holds a moved note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoWChUCsVyST73AjRcdH6D
paulananth added a commit that referenced this pull request Oct 14, 2026
…#959)

* Status sweep: merged PRs ticked; MDM code names join the priority map

- Ticket 01: the profiling gaps (#915, #923), the ownership source
  extracts (#951) and the capacity links (#952) are merged; ticked with
  their merge commits and ET times. Custody rows that stay "unknown" are
  deferred to 07b, the name_id cross-reference.
- mastering-to-done 26 done (#956).
- mastering-to-done 27, the code names, moves into the priority map as
  ticket 73; the old path holds a moved note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoWChUCsVyST73AjRcdH6D

* Record the operator's two ownership rulings and the merge of #958

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoWChUCsVyST73AjRcdH6D

---------

Co-authored-by: Aneena Ananth <aneenaananth@MacBook-Air.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant