Skip to content

fix(api): report rows wider than the header instead of truncating them (#82) - #88

Merged
amar-python merged 2 commits into
mainfrom
fix/issue-82-ragged-rows
Oct 26, 2026
Merged

amar-python merged 2 commits into
mainfrom
fix/issue-82-ragged-rows

Conversation

@amar-python

Copy link
Copy Markdown
Owner

Fixes #82. Part of ART Milestone 1 (BR-34; ART data-preservation constraint).

Change

  • Before: both loaders (dynamic_loader.py, te_loader.py) iterated only over the header's columns, so cells beyond the header width were silently dropped.
  • Now: a row with non-empty cells beyond the header becomes a row error and is not imported:
    • It's counted in failedRows.
    • It's listed in rowErrors with column: "(beyond header)", the first lost value, and a reason naming both widths.
  • Trailing empty cells (a trailing comma from a spreadsheet export) are still accepted, since they carry no data.
  • The shared check lives in csv_parse.extra_cells(), used by both loaders.

The response shape is unchanged, so the frontend's existing row-error UI shows these rows as it shows cast failures.

Evidence

Local PostgreSQL 16, replicating the CI integration job:

Check Result
scripts/test_report.py --strict 245 collected, 245 passed, 0 failed, 0 skipped (239 + 6 new)
evals/runner.py --tiers p,i,s,e 26/26
pytest tests/test_ragged_rows.py 6 passed; with the loader change reverted: 2 failed, the dynamic and T&E ragged-row tests
scripts/lint.sh clean. flake8 on the touched files is clean apart from a pre-existing E305 at csv_parse.py:60, which is also on main

This branch is independent of #86 and #87.


Generated by Claude Code

#82)

Both loaders iterated only over the header's columns, so a row with more
cells than the header lost the extra values without trace. A row with
non-empty cells beyond the header is now a row error (counted in
failedRows, listed in rowErrors with the first lost value) and is not
imported. Empty trailing cells, as left by a trailing comma, are still
accepted. Shared check: csv_parse.extra_cells.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YPoXzBSj89ZHgw7nfTmbB
@amar-python amar-python added this to the ART extension milestone Oct 26, 2026 — with Claude
@amar-python amar-python added bug Something isn't working art ART framework extension work labels Oct 26, 2026 — with Claude
Brings in #87, #90 and #86. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YPoXzBSj89ZHgw7nfTmbB
@amar-python
amar-python merged commit a857f1d into main Oct 26, 2026
3 checks passed
@amar-python
amar-python deleted the fix/issue-82-ragged-rows branch October 27, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

art ART framework extension work bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F2: cells beyond the header width are silently dropped in both loaders

2 participants