Skip to content

Commit

Permalink
Merge branch 'master' into unpin_dask
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 authored Feb 7, 2025
2 parents af500b3 + 7103baf commit 47b620e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 61 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/update_rapids.yml

This file was deleted.

18 changes: 17 additions & 1 deletion R-package/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,24 @@ check.custom.obj <- function(params, objective) {
if (!is.null(params[['objective']]) && !is.null(objective))
stop("Setting objectives in 'params' and 'objective' at the same time is not allowed")

if (!is.null(objective) && typeof(objective) != 'closure')
if (!is.null(objective) && typeof(objective) != 'closure') {
if (is.character(objective)) {
msg <- paste(
"Argument 'objective' is only for custom objectives.",
"For built-in objectives, pass the objective under 'params'.",
sep = " "
)
error_on_deprecated <- getOption("xgboost.strict_mode", default = FALSE)
if (error_on_deprecated) {
stop(msg)
} else {
warning(msg, " This warning will become an error in a future version.")
}
params$objective <- objective
return(list(params = params, objective = NULL))
}
stop("'objective' must be a function")
}

# handle the case when custom objective function was provided through params
if (!is.null(params[['objective']]) &&
Expand Down
16 changes: 0 additions & 16 deletions ops/script/update_rapids.sh

This file was deleted.

0 comments on commit 47b620e

Please sign in to comment.