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

problems() does not get set when readr is loaded, *and* col_select is being used. #534

Open
khusmann opened this issue Apr 13, 2024 · 0 comments

Comments

@khusmann
Copy link

(Running vroom 1.6.5 & readr 2.1.5 on Ubuntu)

When readr is loaded in the environment, and col_select option is being used, the problems() attr gets no longer get attached to the resulting tibble:

library(readr)

bar <- vroom::vroom(
  I("a\n1\n2\nz\n"),
  delim = ",",
  col_types=cols(a = col_double()),
  col_select="a"
)

problems(bar) # No output! attr(bar, "problems") == NULL!

Interestingly, when col_select is not used, it works just fine:

library(readr)

bar <- vroom::vroom(
  I("a\n1\n2\nz\n"),
  delim = ",",
  col_types=cols(a = col_double())
)

problems(bar)
#> Warning: One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#>   dat <- vroom(...)
#>   problems(dat)
#> # A tibble: 1 × 5
#>     row   col expected actual file                              
#>   <int> <int> <chr>    <chr>  <chr>                             
#> 1     4     1 a double z      /tmp/Rtmp62LnNu/file1d276c1662f970

It also works just fine when readr is not loaded:

library(vroom)

bar <- vroom(
  I("a\n1\n2\nz\n"),
  delim = ",",
  col_types=cols(a = col_double()),
  col_select="a"
)

problems(bar)
#> Warning: One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#>   dat <- vroom(...)
#>   problems(dat)
#> # A tibble: 1 × 5
#>     row   col expected actual file                             
#>   <int> <int> <chr>    <chr>  <chr>                            
#> 1     4     1 a double z      /tmp/RtmpYwCnXv/file1d26632e67a7f
@khusmann khusmann changed the title problems() does not get set when readr is loaded, **and** col_select is being used. problems() does not get set when readr is loaded, *and* col_select is being used. Apr 13, 2024
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

No branches or pull requests

1 participant