-
Notifications
You must be signed in to change notification settings - Fork 1
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
tibble: A tbl
may contain an external pointer via attribute problems
set by readr
#9
Comments
It's actually the readr package that adds the "Readr functions will only throw an error if parsing fails in an unrecoverable way. However, there are lots of potential problems that you might want to know about - these are stored in the |
tbl
may contain an external pointer via attribute problems
tbl
may contain an external pointer via attribute problems
set by **readr**
|
tbl
may contain an external pointer via attribute problems
set by **readr**tbl
may contain an external pointer via attribute problems
set by readr
Ah, the > x <- parse_integer(c("1X", "blah", "3"))
Warning: 2 parsing failures.
row col expected actual
1 -- no trailing characters 1X
2 -- no trailing characters blah
> str(x)
int [1:3] NA NA 3
- attr(*, "problems")= tibble [2 × 4] (S3: tbl_df/tbl/data.frame)
..$ row : int [1:2] 1 2
..$ col : int [1:2] NA NA
..$ expected: chr [1:2] "no trailing characters" "no trailing characters"
..$ actual : chr [1:2] "1X" "blah" More clues about alternatives can be found in: readr:::problems
function (x = .Last.value)
{
problems <- probs(x)
if (is.null(problems)) {
return(invisible(no_problems))
}
if (inherits(problems, "tbl_df")) {
return(problems)
}
vroom::problems(x)
} So, it looks like vroom might be involved too; > vroom::problems
function (x = .Last.value, lazy = FALSE)
{
if (!inherits(x, "tbl_df")) {
cli::cli_abort(c("The {.arg x} argument of {.fun vroom::problems} must be a data frame created by vroom:",
x = "{.arg x} has class {.cls {class(x)}}"))
}
if (!isTRUE(lazy)) {
vroom_materialize(x, replace = FALSE)
}
probs <- attr(x, "problems")
if (typeof(probs) != "externalptr") {
cli::cli_abort(c("The {.arg x} argument of {.fun vroom::problems} must be a data frame created by vroom:",
x = "{.arg x} seems to have been created with something else, maybe readr?"))
}
probs <- vroom_errors_(probs)
probs <- probs[!duplicated(probs), ]
probs <- probs[order(probs$file, probs$row, probs$col), ]
tibble::as_tibble(probs)
}
<environment: namespace:vroom> |
From the above, marshalling of prune.tbl_df <- function(x, ...) {
problems <- attr(x, "problems", exact = TRUE)
## Materialize `problems` stored elsewhere in this process?
if (typeof(problems) == "externalptr") {
problems <- vroom::problems(x)
attr(x, "problems") <- problems
}
x
} Comment: We could use Comment 2: We've punted on the idea of having |
A
tbl
may contain an external pointer via attributeproblems
, e.g.The text was updated successfully, but these errors were encountered: