Skip to content

fix(push): set LazyQuotes on CSV readers (completes #222 — avoids a false-reject) - #225

Merged
saadqbal merged 1 commit into
developfrom
fix/openreader-lazyquotes
Jul 10, 2026
Merged

fix(push): set LazyQuotes on CSV readers (completes #222 — avoids a false-reject)#225
saadqbal merged 1 commit into
developfrom
fix/openreader-lazyquotes

Conversation

@saadqbal

@saadqbalsaadqbal commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Why this is a follow-up to #222

#222 landed the fail-closed-on-read-error change, but was merged before the root-cause commit could be added to it — so develop currently has a regression: openCSVReader sets FieldsPerRecord=-1 but not LazyQuotes, so a bare/unescaped quote (which pandas/the ingestor tolerates) makes csv.Reader.Read return a parse error. Combined with #222's fail-closed change, a bare-quote CSV now hard-fails preflight — a false-reject of a layout the cluster ingests cleanly. (Before #222 it was a silent skip / fail-open; #222 correctly closed that, but without LazyQuotes it swung to the opposite wrong.)

Fix

Set LazyQuotes = true centrally in openCSVReader (fixes CrossCheckLabels, readLabelColumnValues, CheckSequenceRows, CheckHasDataRows, ReadCSVHeader at once) and in InferSchema's own reader. The readers are now pandas-faithful; the remaining non-EOF Read error is genuinely I/O-only, so #222's fail-closed handling is correct. Added a bare-quote guard test; the full value/verdict parity harness passes, confirming LazyQuotes doesn't over-accept relative to the ingestor.

Scope

Completes the read-error fix set (#221/#222) surfaced by Bugbot on #219; rolls up under release ticket #220; should land before v0.8.0 so the release doesn't ship the false-reject.

🤖 Generated with Claude Code


Note

Medium Risk
Touches all pandas-mirrored preflight CSV walks and schema inference; wrong quote handling could still false-reject or over-accept vs the ingestor, though parity tests are meant to guard that.

Overview
Turns on LazyQuotes on the shared openCSVReader path and on InferSchema’s reader so bare/unescaped quotes in data rows are tolerated like pandas/the ingestor, instead of making Go’s strict csv.Reader fail preflight.

That closes the regression from fail-closed read handling (#222): CSVs the cluster would ingest were being false-rejected at preflight when a row contained a quote pandas keeps. With FieldsPerRecord = -1 and LazyQuotes, non-EOF read errors are treated as real I/O failures only, so existing fail-closed behavior stays correct.

Adds TestOpenCSVReader_LazyQuotesMatchesPandas so label diversity and value reads still see all rows (e.g. three rows, two classes) on a bare-quote fixture.

Reviewed by Cursor Bugbot for commit 9262748. Bugbot is set up for automated code reviews on this repo. Configure here.

…e-reject
Root cause behind the read-error findings: openCSVReader set FieldsPerRecord=-1
but NOT LazyQuotes, so a bare/unescaped quote in a row — which pandas (the
ingestor) tolerates — made csv.Reader.Read return a parse error. Every preflight
mirror-check (CrossCheckLabels, readLabelColumnValues, CheckSequenceRows,
CheckHasDataRows, ReadCSVHeader) therefore diverged from the ingestor in the
inverse direction: it REJECTED a layout the cluster ingests cleanly.
It also meant the fail-closed change earlier in this PR was reachable via a
bare-quote row, turning a fail-open into a false-reject. Setting LazyQuotes
centrally in openCSVReader (and in InferSchema's own reader, which doesn't use
it) makes the readers pandas-faithful; the remaining non-EOF Read error is then
only ever genuine I/O, so failing closed on it is correct.
Added a parity guard test (bare-quote CSV → read like pandas, not rejected).
The full value/verdict parity harness still passes, confirming LazyQuotes does
not over-accept relative to the ingestor.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@saadqbal
saadqbal merged commit ef672f2 into developJul 10, 2026
20 checks passed
@saadqbal
saadqbal deleted the fix/openreader-lazyquotes branch July 10, 2026 16:32
Sign up for freeto 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.

2 participants

@saadqbal@LukasWodka