Skip to content

Improved empty row handling#307

Merged
vincentlaucsb merged 4 commits intomasterfrom
empty-row-handling
Apr 19, 2026
Merged

Improved empty row handling#307
vincentlaucsb merged 4 commits intomasterfrom
empty-row-handling

Conversation

@vincentlaucsb
Copy link
Copy Markdown
Owner

@vincentlaucsb vincentlaucsb commented Apr 19, 2026

Fixes #242. See release notes and README for deets.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.86%. Comparing base (cdc978f) to head (f1acc05).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
include/internal/csv_reader.cpp 60.00% 1 Missing and 5 partials ⚠️
include/internal/basic_csv_parser.cpp 88.88% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #307      +/-   ##
==========================================
- Coverage   89.89%   89.86%   -0.04%     
==========================================
  Files          25       25              
  Lines        1633     1657      +24     
  Branches      684      700      +16     
==========================================
+ Hits         1468     1489      +21     
  Misses         45       45              
- Partials      120      123       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return get_csv_head(filename, get_file_size(filename));
}

CSV_INLINE size_t infer_n_cols_from_head(csv::string_view head, CSVFormat format) {
Comment thread tests/test_read_csv.cpp Dismissed
Comment thread tests/test_read_csv.cpp
vector<string>({ "4", "5", "6", "" }));
}

TEST_CASE("Test Quoted Empty Single-Column Row", "[read_csv_empty_last_column]") {
Comment thread tests/test_read_csv.cpp

// Verify the CSV parser can handle any arbitrary line endings composed of carriage return & newline
TEST_CASE("Cursed Newlines", "[read_csv_cursed_newline]") {
TEST_CASE("Normal Newlines", "[read_csv_normal_newline]") {
Comment thread tests/test_read_csv.cpp
}


TEST_CASE("Edge-Case Newlines", "[read_csv_edge_case_newline]") {
@vincentlaucsb vincentlaucsb merged commit 786023f into master Apr 19, 2026
26 checks passed
@vincentlaucsb vincentlaucsb deleted the empty-row-handling branch April 19, 2026 02:17
Sign up for free to 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.

How can I read blank lines?

2 participants