Conversation
…0, FsCheck 2.16.6 - FAKE packages: 6.1.3 → 6.1.4 (patch) - NUnit: 3.13.1 → 3.13.3 (patch) - FsUnit: 4.0.4 → 4.2.0 (minor) - FsCheck: 2.15.1 → 2.16.6 (minor) Build: passes (0 errors) Tests: all offline tests pass; network tests skip due to sandbox Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… quoted fields The maxNumberOfRows text-truncation in parseTextAtDesignTime counted text lines using reader.ReadLine(), which broke CSV files where a single data row spans multiple text lines due to quoted fields (e.g. "multi-\nline",2). Fix: pass None as maxNumberOfRows so the raw text is never pre-truncated. Row-count limiting is already handled correctly by InferColumnTypes via Seq.truncate inferRows - this has always been the authoritative row limit. The performance cost is reading the full sample file as a string; this is the same cost as all other providers (XmlProvider, JsonProvider) which also pass None here. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
✅ Pull request created: #1625 |
3 tasks
Base automatically changed from
repo-assist/deps-update-2026-02-22-22f87c2bfdc6ec83
to
main
February 22, 2026 22:10
…ne-csv-9645f782b479e0ac
github-actions bot
added a commit
that referenced
this pull request
Feb 23, 2026
Add entries for: - #1613: CSS pseudo-class NotSupportedException fix (#1383) - #1617: ConvertDateTimeOffset xs:dateTime fallback fix (#1437) - #1618: Microsoft.Build security bump - #1619: XmlProvider EmbeddedResource GetSchema fix (#1310) - #1621: StrictBooleans parameter for CsvProvider - #1625: CsvProvider.InferRows multiline quoted field fix (#1439) - #1626: XSD group reference cycle guard (#1419) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 free
to 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.
🤖 This is an automated draft PR from Repo Assist, an AI assistant.
Summary
Fixes #1439 —
CsvProviderwithInferRows = Nfailed when the sample file contained quoted fields spanning multiple text lines (e.g."multi-\nline",2). The type provider raisedExpected 2 columns, got 1because the raw text was truncated mid-row.Root Cause
Helpers.fs→parseTextAtDesignTimeusedreader.ReadLine()to count rows:This counts text lines, not CSV data rows. A single CSV row containing a quoted multiline field occupies N text lines but should count as just 1 row against the
InferRowslimit. The truncated string then causedCsvFile.Parseto see an incomplete quoted field, triggering a parse error.Fix
Pass
NoneasmaxNumberOfRowstogenerateTypeforCsvProvider. The raw text is no longer pre-truncated by line count. Row limiting during inference is handled correctly byInferColumnTypeswhich already callsSeq.truncate inferRows— this is the authoritative row limit.This matches the behaviour of
XmlProviderandJsonProvider, which also passNonehere.Performance note: the full sample file is now read into a string at design time. For typical sample files (the intended use — representative excerpts, not production datasets) this is negligible. The CSV row parsing via
StringReaderremains lazy, so onlyinferRowsrows are actually parsed.Trade-offs
Test Status
✅ New test added:
InferRows counts CSV rows not text lines for multiline quoted fields✅ All 250 existing tests pass (
dotnet test tests/FSharp.Data.Tests/FSharp.Data.Tests.fsproj -c Release)