Skip to content

Conversation

@kragol
Copy link
Contributor

@kragol kragol commented Jul 8, 2020

Fixes #679
This may not be the cleanest fix but it seems to work. I guess it can be fine for now since the whole parsing is apparently in the process of being rewritten.

Note: I am a Julia beginner so any feedback is appreciated.

@codecov
Copy link

codecov bot commented Jul 9, 2020

Codecov Report

Merging #681 into master will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #681      +/-   ##
==========================================
- Coverage   84.47%   84.42%   -0.05%     
==========================================
  Files          10       10              
  Lines        1778     1779       +1     
==========================================
  Hits         1502     1502              
- Misses        276      277       +1     
Impacted Files Coverage Δ
src/file.jl 96.30% <100.00%> (ø)
src/utils.jl 81.64% <0.00%> (-0.40%) ⬇️

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 131f233...8b2926e. Read the comment docs.

quinnj added a commit that referenced this pull request Jul 9, 2020
Fixes #679; alternative fix to #681. When a column is dropped, we
essentially turn it into a `Missing` column type and ignore it when
parsing. There was a check later in file parsing, however, that said if
no missing values were found in a column, to ensure its type is
`Vector{T}` instead of `Vector{Union{Missing, T}}`. The core problem in
issue #679 was that these dropped columns, while completely `missing`,
didn't get "flagged" as having `missing` values.
@quinnj
Copy link
Member

quinnj commented Jul 9, 2020

Thanks for reporting the issue @kragol! And proposing a fix! While this fix is fine, there's actually a slightly simpler fix that I've put up in #683. We have a flags array that carries various bit flags that get/set properties for columns, one of which is if anymissing values were parsed. So my alternative fix is to just make sure when a column is marked as WILLDROP, we also mark ANYMISSING since the entire column will be treated as missing values.

@quinnj quinnj closed this Jul 9, 2020
quinnj added a commit that referenced this pull request Jan 12, 2026
Fixes #679; alternative fix to #681. When a column is dropped, we
essentially turn it into a `Missing` column type and ignore it when
parsing. There was a check later in file parsing, however, that said if
no missing values were found in a column, to ensure its type is
`Vector{T}` instead of `Vector{Union{Missing, T}}`. The core problem in
issue #679 was that these dropped columns, while completely `missing`,
didn't get "flagged" as having `missing` values.
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.

error with combination of types and select/drop options of CSV.File

2 participants