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

Fix CSV.Rows when missing values are parsed #904

Merged
merged 1 commit into from
Sep 15, 2021
Merged

Fix CSV.Rows when missing values are parsed #904

merged 1 commit into from
Sep 15, 2021

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Sep 15, 2021

Fixes #903. The issue here is a consequence of the big internal
refactoring that happened for the 0.9 release. Part of the refactoring
is that parserow doesn't explicitly set a column's value to missing
if a sentinel value is detected while parsing. This is because when a
column is allocated, it's allocated with "all missing" values set, so it
should already be set to missing. This doesn't hold up, however, for
CSV.Rows, where we only allocate a single element "column" vector for
each column and reuse it when iterating rows. The solution, therefore,
is to "reset" the column vectors before each call to parserow to
ensure the column values are set to missing in case a sentinel value is
detected while parsing.

Fixes #903. The issue here is a consequence of the big internal
refactoring that happened for the 0.9 release. Part of the refactoring
is that `parserow` doesn't explicitly set a column's value to `missing`
if a sentinel value is detected while parsing. This is because when a
column is allocated, it's allocated with "all missing" values set, so it
_should_ already be set to missing. This doesn't hold up, however, for
`CSV.Rows`, where we only allocate a single element "column" vector for
each column and reuse it when iterating rows. The solution, therefore,
is to "reset" the column vectors before each call to `parserow` to
ensure the column values are set to missing in case a sentinel value is
detected while parsing.
@codecov
Copy link

codecov bot commented Sep 15, 2021

Codecov Report

Merging #904 (b317182) into main (4886c49) will decrease coverage by 0.88%.
The diff coverage is 41.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #904      +/-   ##
==========================================
- Coverage   90.56%   89.68%   -0.89%     
==========================================
  Files           9        9              
  Lines        2162     2181      +19     
==========================================
- Hits         1958     1956       -2     
- Misses        204      225      +21     
Impacted Files Coverage Δ
src/rows.jl 78.01% <40.00%> (-9.42%) ⬇️
src/utils.jl 84.98% <66.66%> (-0.19%) ⬇️

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 4886c49...b317182. Read the comment docs.

@quinnj quinnj merged commit b0032e8 into main Sep 15, 2021
@quinnj quinnj deleted the jq/903 branch September 15, 2021 05:48
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.

Columns with missing data are filled with stale data using CSV.Rows
1 participant