Added AllowFieldCountMismatch property to CsvConfiguration - #985
Added AllowFieldCountMismatch property to CsvConfiguration#985michelebastione wants to merge 2 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
ChangesCSV jagged-row handling
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/MiniExcel.Csv/CsvReader.cs`:
- Around line 67-133: Update the invalid-row check before the header and
headerless branches to reject any field-count mismatch when
AllowFieldCountMismatch is false, not only rows where fields.Length is less than
headerRow.Count. Preserve the existing ColumnNotFoundException construction and
ensure both hasHeaderRow paths exit through this check before assigning fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f567c7b8-2687-4a1f-bf0f-0c366b9d374b
📒 Files selected for processing (5)
src/MiniExcel.Csv/CsvConfiguration.cssrc/MiniExcel.Csv/CsvReader.cstests/MiniExcel.Csv.Tests/Main/MiniExcelCsvAsyncTests.cstests/MiniExcel.Csv.Tests/Main/MiniExcelCsvTests.cstests/MiniExcel.Csv.Tests/Main/Models.cs
077f1e6 to
6d1fa3e
Compare
The implementation of this property makes jagged rows being returned as they are instead of having an exception being thrown when a mismatched number of fields is found.
6d1fa3e to
0cdea67
Compare
The implementation of this property makes jagged rows being returned as they are instead of having an exception being thrown when a mismatched number of fields is found.
Resolves #979
Summary by CodeRabbit
New Features
Bug Fixes
Deprecation