dplyr icon indicating copy to clipboard operation
dplyr copied to clipboard

Remove lazy eval fallbacks (>= Sept 2023)

Open hadley opened this issue 3 years ago • 5 comments

They shouldn't be needed anymore, and they make the error messages unnecessarily confusing. (Have been deprecated since 0.7.0 released June 2017)

hadley avatar Oct 26 '20 16:10 hadley

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"
  )
}

romainfrancois avatar Nov 04 '20 11:11 romainfrancois

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.

hadley avatar Nov 04 '20 12:11 hadley

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 ?

romainfrancois avatar Nov 05 '20 15:11 romainfrancois

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.

hadley avatar Nov 05 '20 17:11 hadley

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).

hadley avatar Aug 04 '22 22:08 hadley