File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -616,7 +616,22 @@ dplyr_quosures <- function(...) {
616616 quosures
617617}
618618
619- # Always guaranteed to be 1 quosure in, 1 quosure out, unlike `expand_across()`
619+ # Expand an `if_any()` or `if_all()` call
620+ #
621+ # Always guaranteed to be 1 quosure in, 1 quosure out, unlike `expand_across()`.
622+ #
623+ # For the dplyr backend, the main reason we expand at all is to evaluate
624+ # tidyselection exactly once (rather than once per group), because tidyselection
625+ # is rather slow.
626+ #
627+ # At one point we believed `if_any()` and `if_all()` could be implemented as
628+ # "pure expansion" that would run before dispatching to other backends, like
629+ # dbplyr. In theory this could expand to a chain of `&` and `|` operations that
630+ # dbplyr would already know how to translate (so dbplyr itself would not have to
631+ # know how to implement `if_any()` and `if_all()`), but in practice we need more
632+ # error checking than what `x & y & z` gets us, so we actually expand to a
633+ # vctrs-backed implementation since the "pure expansion" ideas have never played
634+ # out.
620635expand_if_across <- function (quo ) {
621636 if (quo_is_call(quo , " if_any" , ns = c(" " , " dplyr" ))) {
622637 variant <- " any"
You can’t perform that action at this time.
0 commit comments