diff --git a/r/R/metadata.R b/r/R/metadata.R index 206a18d09ff..dbc8c6b6390 100644 --- a/r/R/metadata.R +++ b/r/R/metadata.R @@ -188,8 +188,7 @@ apply_arrow_r_metadata <- function(x, r_metadata) { # we cannot apply this row-level metadata, since the order of the rows is # not guaranteed to be the same, so don't even try, but warn what's going on trace <- trace_back() - # TODO: remove `trace$calls %||% trace$call` once rlang > 0.4.11 is released - in_dplyr_collect <- any(map_lgl(trace$calls %||% trace$call, function(x) { + in_dplyr_collect <- any(map_lgl(trace$call, function(x) { grepl("collect\\.([aA]rrow|Dataset)", x)[[1]] })) if (in_dplyr_collect) { @@ -296,8 +295,7 @@ arrow_attributes <- function(x, only_top_level = FALSE) { # we cannot apply this row-level metadata, since the order of the rows is # not guaranteed to be the same, so don't even try, but warn what's going on trace <- trace_back() - # TODO: remove `trace$calls %||% trace$call` once rlang > 0.4.11 is released - in_dataset_write <- any(map_lgl(trace$calls %||% trace$call, function(x) { + in_dataset_write <- any(map_lgl(trace$call, function(x) { grepl("write_dataset", x, fixed = TRUE)[[1]] })) if (in_dataset_write) {