Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure we check for commented rows when skipping rows for header/data #789

Merged
merged 5 commits into from Nov 24, 2020

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Nov 24, 2020

Improves #788. In the original issue, a quote character on a commented
row messes the parsing positioning up because it's looking for a closing
quote character. By checking for and skipping commented rows, no matter
the characters present, we ensure parsing integrity. One ramification of
this, however, is that commented rows now "no longer count" when
considering row numbers, i.e. when specifying the header=2 or
datarow=4 keyword arguments, because the commented rows are literally
ignored when parsing. This seems fine to me, but probably warrants some
documentation so it's clear.

Update: this PR has been updated from the original approach to count commented/empty rows when specifying a header or datarow argument; this seems more natural/intuitive (i.e. look at a file, count # of rows, and provide it as an arg), and helps preserve existing behavior (i.e. non-breaking). If a header/datarow keyword arg is provided and that row in the file is commented or empty, we will skip to the first non-commented/non-empty row to parse the header/data.

Improves #788. In the original issue, a quote character on a commented
row messes the parsing positioning up because it's looking for a closing
quote character. By checking for and skipping commented rows, no matter
the characters present, we ensure parsing integrity. One ramification of
this, however, is that commented rows now "no longer count" when
considering row numbers, i.e. when specifying the `header=2` or
`datarow=4` keyword arguments, because the commented rows are literally
ignored when parsing. This seems fine to me, but probably warrants some
documentation so it's clear.
@codecov
Copy link

codecov bot commented Nov 24, 2020

Codecov Report

Merging #789 (7308bb3) into master (c94256a) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #789      +/-   ##
==========================================
+ Coverage   91.78%   91.82%   +0.04%     
==========================================
  Files           9        9              
  Lines        1802     1811       +9     
==========================================
+ Hits         1654     1663       +9     
  Misses        148      148              
Impacted Files Coverage Δ
src/rows.jl 92.59% <ø> (ø)
src/detection.jl 95.15% <100.00%> (+0.11%) ⬆️
src/file.jl 94.63% <100.00%> (ø)
src/header.jl 95.62% <100.00%> (ø)
src/utils.jl 87.61% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c94256a...7308bb3. Read the comment docs.

@quinnj quinnj merged commit def726a into master Nov 24, 2020
@quinnj quinnj deleted the jq/788 branch November 24, 2020 23:51
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.

None yet

1 participant