You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that vroom does not throw a warning when the parsing according to a column specification fails. This seems very dangerous, since the use would have to check manually if the parsing went fine. For large data (where I would like to use vroom instead of readr) this is likely to be infeasible. Here is an example:
library(readr)
library(vroom)
# readr + correct specification
(read_csv(
"A,B\n1,2020-01-01",
col_types= cols(A= col_integer(), B= col_date())
))
#> # A tibble: 1 x 2#> A B #> <int> <date> #> 1 1 2020-01-01# readr + incorrect specification
(read_csv(
"A,B\n1,2020-01-01",
col_types= cols(B= col_integer(), A= col_date())
))
#> Warning: 2 parsing failures.#> row col expected actual file#> 1 A date like 1 literal data#> 1 B no trailing characters -01-01 literal data#> # A tibble: 1 x 2#> A B#> <date> <int>#> 1 NA NA# readr warns about parsing errors# vroom + correct specification
(vroom(
"A,B\n1,2020-01-01",
col_types= cols(A= col_integer(), B= col_date())
))
#> # A tibble: 1 x 2#> A B #> <int> <date> #> 1 1 2020-01-01# vroom + incorrect specification
(vroom(
"A,B\n1,2020-01-01",
col_types= cols(B= col_integer(), A= col_date())
))
#> # A tibble: 1 x 2#> A B#> <date> <int>#> 1 NA NA# vroom does not warn about parsing errors
Would it be possible to more or less copy & paste the respective code from readr to vroom to gain the safety? Alternatively, vroom could fall back to character, like data.table does when a column can't be parsed as specified.
The text was updated successfully, but these errors were encountered:
Yes, this is a known limitation in the current implementation. It is not trivial to do however as the parsing is done lazily, but it is planned to add something like readr's warnings for future work.
I noticed that
vroom
does not throw a warning when the parsing according to a column specification fails. This seems very dangerous, since the use would have to check manually if the parsing went fine. For large data (where I would like to usevroom
instead ofreadr
) this is likely to be infeasible. Here is an example:Created on 2020-07-03 by the reprex package (v0.3.0)
Would it be possible to more or less copy & paste the respective code from
readr
tovroom
to gain the safety? Alternatively,vroom
could fall back tocharacter
, likedata.table
does when a column can't be parsed as specified.The text was updated successfully, but these errors were encountered: