-
Notifications
You must be signed in to change notification settings - Fork 90
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
updated messages to use cli. #1151
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A strong start! I've suggested some changes that should resolve the test failures we see here. :)
|
||
cli::cli_warn( | ||
"{.val {min_child_weight}} samples were requested but there were {.val {n}} | ||
rows in the data. Therefore {.val {n}} will be used" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rows in the data. Therefore {.val {n}} will be used" | |
rows in the data. Therefore {.val {n}} will be used." |
cli::cli_abort( | ||
"The option `counts = TRUE` was used but parameter {.arg nm}, | ||
was given as signif(x, 3).Please use a value >= 1 | ||
or set {.code counts = FALSE}." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cli::cli_abort( | |
"The option `counts = TRUE` was used but parameter {.arg nm}, | |
was given as signif(x, 3).Please use a value >= 1 | |
or set {.code counts = FALSE}." | |
cli::cli_abort( | |
"The option `counts = TRUE` was used but parameter {.arg nm}, | |
was given as signif(x, 3). Please use a value >= 1 | |
or set {.code counts = FALSE}." |
I'm seeing package tests failing related to this test:
Error in `maybe_proportion(x, nm)`: The option `counts = TRUE` was used but parameter `nm`, was given as signif(x, 3).Please use a value >= 1 or set `counts = FALSE`.
Could you transition that test from using expect_error()
to expect_snapshot(error = TRUE, ...)
?
cli::cli_warn( | ||
c( | ||
"{.val {minCases}} samples were requested but there were {.val {n}} rows in the data.", | ||
"Therefore {.val {n}} will be used" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Therefore {.val {n}} will be used" | |
"{.val {n}} will be used." |
} | ||
|
||
if (!is.null(early_stop)) { | ||
if (early_stop <= 1) { | ||
rlang::abort(paste0("`early_stop` should be on [2, ", nrounds, ").")) | ||
cli::cli_abort("{.arg early_stop} should be on {.val [2,{nrounds})}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cli::cli_abort("{.arg early_stop} should be on {.val [2,{nrounds})}") | |
cli::cli_abort("{.arg early_stop} should be on {.val [2, {nrounds})}.") |
} else if (early_stop >= nrounds) { | ||
early_stop <- nrounds - 1 | ||
rlang::warn(paste0("`early_stop` was reduced to ", early_stop, ".")) | ||
cli::cli_warn("{.arg early_stop} was reduced to {.val {early_stop}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cli::cli_warn("{.arg early_stop} was reduced to {.val {early_stop}}") | |
cli::cli_warn("{.arg early_stop} was reduced to {.val {early_stop}}.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, meant to leave the review as a Comment!
@shum461, do you have interest in working on those suggested changes or would you prefer we take it from here? |
Will go ahead and close. Thank you for the PR! |
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. |
Fixes #1139