dplyr
dplyr copied to clipboard
Remove lazy eval fallbacks (>= Sept 2023)
They shouldn't be needed anymore, and they make the error messages unnecessarily confusing. (Have been deprecated since 0.7.0 released June 2017)
Should we first go though a deprecate_stop()
version, i.e.
lazy_deprec <- function(fun, hint = TRUE) {
lifecycle::deprecate_stop("0.7.0", paste0(fun, "_()"), paste0(fun, "()"),
details = if (hint) "See vignette('programming') for more help"
)
}
I think that only helps package authors a little, and still generates confusion for end users.
This is the main problem:
> dplyr::summarise(mean)
Error in UseMethod("summarise_") :
no applicable method for 'summarise_' applied to an object of class "function"
In addition: Warning message:
`summarise_()` is deprecated as of dplyr 0.7.0.
Please use `summarise()` instead.
oh, do you mean that we remove them altogether or just the fact they are used as fallbacks, i.e. just remove
#' @export
summarise.default <- function(.data, ...) {
summarise_(.data, .dots = compat_as_lazy_dots(...))
}
but keep summarise_()
and its methods ?
I was thinking removing altogether, but I think your suggestion to just remove the default method is better, and then we can remove all the verbs in a bigger release.
I tried hard deprecating in July 2022 (#6366) but there were 100+ failures. I think the next step is convert these to always warn (#6387) and consider again in a year after release (e.g. September 2023).