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
Suppress (or attend to) warnings and messages in examples #343
Comments
@IndrajeetPatil Why would this pass but suddenly fail when https://github.com/easystats/effectsize/actions/workflows/check-all-examples.yaml |
@mattansb It has actually nothing to do with the new strict check. Previously, the “check all examples” workflow was checking only that all examples run. Now, it additionally checks that examples don’t produce warnings. That’s what the current issue is about. |
Ahhhhh ok. Thanks! |
@IndrajeetPatil Is it possible to ignore some warnings (without using https://github.com/easystats/datawizard/actions/runs/3918766334/jobs/6699343379 library(datawizard)
test <- data.frame(
a = c("iso", 2, 5),
b = c("year", 3, 6),
c = c(NA, 5, 7)
)
test
#> a b c
#> 1 iso year NA
#> 2 2 3 5
#> 3 5 6 7
row_to_colnames(test)
#> Warning: Some values of row 1 were NAs. The corresponding column names are
#> prefixed with `x`.
#> iso year x1
#> 2 2 3 5
#> 3 5 6 7 |
Hmm, I am wondering if it's really necessary to show an example that is going to generate a warning. Typically, the help page examples will expose the functionality but not the edge cases users might run into, which is where they are likely to see warnings and errors. Does that make sense? That said, if you do want to retain that example, maybe just set |
Right, it doesn't bring much to show warnings in the example, I'll change the example |
In examples I often see that we load the current package, but I've never seen that anywhere else before. Why do we do that? Should I remove those instances? |
Yeah, I have also noticed this. It's definitely not necessary, but I don't feel strongly either way. I think you can let them be for now. We do have a number of other, more immediate issues to resolve that we can prioritize. |
Due to lazyness, I copy/paste examples into an R file, and then I don't need to load the related library manually. |
No more warnings in examples for |
Some examples have warnings (and therefore this check fails) because of the environment problem due to
This only happens in |
Follow-up on #338
The
check-all-examples
workflow should pass.You can work on this issue either when #338 is resolved for the repo(s) you are maintaining, or work on both issues at the same time.
Preamble
Same as #338
Examples
Same as #338
Progress tracker
The text was updated successfully, but these errors were encountered: