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

no longer using dplyr_error #239

Closed
wants to merge 1 commit into from

Conversation

romainfrancois
Copy link

dplyr 1.0.8 will stop using classed errors of type "dplyr_error".

This will also fail because of r-lib/testthat#1493, for example:

Failure (test-error-handling.R:11:3): `truth` should be factor
`sens(pathology, 1, factor("A"))` threw an error with unexpected message.
Expected match: "`truth` should be a factor"
Actual message: "Problem while computing `.estimate = metric_fn(truth = 1, estimate = factor(\"A\"), na_rm = na_rm, event_level = \"first\")`."
Backtrace:
  1. testthat::expect_error(sens(pathology, 1, factor("A")), "`truth` should be a factor")
       at test-error-handling.R:11:2
 17. yardstick metric_fn(truth = 1, estimate = factor("A"), na_rm = na_rm, event_level = "first")
 18. yardstick::metric_vec_template(...)
       at yardstick/R/class-sens.R:147:2
 19. yardstick::validate_truth_estimate_checks(...)
       at yardstick/R/template.R:174:2
 20. yardstick::validate_class(truth, "truth", cls[1])
       at yardstick/R/validation.R:201:2

Perhaps it's a good signal to start using snapshot tests here too.

@DavisVaughan
Copy link
Member

I'll probably just make these expect_snapshot(expect_error())? I think that would avoid both issues right?

@romainfrancois
Copy link
Author

Yeah I guess so.

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants