Uh oh!
There was an error while loading. Please reload this page.
fix(push): set LazyQuotes on CSV readers (completes #222 — avoids a false-reject) - #225
Merged
Merged
Conversation
…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>
4 tasks
LukasWodka
approved these changes
Jul 10, 2026
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 freeto 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.
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:
openCSVReadersetsFieldsPerRecord=-1but notLazyQuotes, so a bare/unescaped quote (which pandas/the ingestor tolerates) makescsv.Reader.Readreturn 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 withoutLazyQuotesit swung to the opposite wrong.)Fix
Set
LazyQuotes = truecentrally inopenCSVReader(fixesCrossCheckLabels,readLabelColumnValues,CheckSequenceRows,CheckHasDataRows,ReadCSVHeaderat once) and inInferSchema's own reader. The readers are now pandas-faithful; the remaining non-EOFReaderror 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, confirmingLazyQuotesdoesn'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
LazyQuoteson the sharedopenCSVReaderpath and onInferSchema’s reader so bare/unescaped quotes in data rows are tolerated like pandas/the ingestor, instead of making Go’s strictcsv.Readerfail 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 = -1andLazyQuotes, non-EOF read errors are treated as real I/O failures only, so existing fail-closed behavior stays correct.Adds
TestOpenCSVReader_LazyQuotesMatchesPandasso 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.