-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
condition handling ignores locally set options #6943
Labels
bug
an unexpected problem or unintended behavior
Comments
I have been caught by a similar issue the other way around where warnings appear that should not be there: require(dplyr)
#> Loading required package: dplyr
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
no_warn <- function() {
withr::local_options(warn = -1)
rlang::warn("oops") # some operation that produces a warning that should be ignored
24
}
no_warn()
#> [1] 24
data.frame(a=1:2) %>% mutate(b=no_warn())
#> Warning: There was 1 warning in `mutate()`.
#> ℹ In argument: `b = no_warn()`.
#> Caused by warning:
#> ! oops
#> a b
#> 1 1 24
#> 2 2 24 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe because of a delayed evaluation issue ?
Created on 2023-10-25 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: