Skip to content

vroom_lines() warns about problems but problems() doesn't work on its output #607

@jennybc

Description

@jennybc

When vroom_lines() encounters a parsing issue (e.g., an embedded null byte), it emits a warning directing users to call problems(). However, problems() rejects the character vector returned by vroom_lines(), leaving users with no way to get more details on what went wrong.

Note: This issue is exposed by a fix in #604, which improves null byte handling in vroom_lines(). In released vroom, the whole embedded null byte issue is silently swallowed which is also not good.

tmp <- withr::local_tempfile()
writeBin(c(charToRaw("line1\n"), as.raw(0x00), charToRaw("line2\n")), tmp)

x <- vroom::vroom_lines(tmp)
x
#> [1]
#> Warning: One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#>   dat <- vroom(...)
#>   problems(dat)
#>  "line1" ""
vroom::problems(x)
#> Error in `vroom::problems()`:
#> ! The `x` argument of `vroom::problems()` must be a data frame created
#>   by vroom:
#> ✖ `x` has class <character>

Created on 2026-01-21 with reprex v2.1.1

vroom_lines() calls vroom_() internally, which returns a data frame with a problems attribute. But vroom_lines() then extracts just the first column (out[[1]]), discarding the problems attribute. Plus problem reporting also refuses to work with a non-data.frame object.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions