Skip to content

Commit 43e2145

Browse files
committed
Use lifecycle tooling for pkgconfig deprecation message
1 parent 6493816 commit 43e2145

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

R/join.R

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,12 @@ join_mutate <- function(
701701
) {
702702
check_dots_empty0(...)
703703

704-
na_matches <- check_na_matches(na_matches, error_call = error_call)
704+
na_matches <- check_na_matches(
705+
na_matches,
706+
error_call = error_call,
707+
user_env = user_env
708+
)
709+
705710
check_keep(keep, error_call = error_call)
706711

707712
x_names <- tbl_vars(x)
@@ -809,7 +814,11 @@ join_filter <- function(
809814
) {
810815
check_dots_empty0(...)
811816

812-
na_matches <- check_na_matches(na_matches, error_call = error_call)
817+
na_matches <- check_na_matches(
818+
na_matches,
819+
error_call = error_call,
820+
user_env = user_env
821+
)
813822

814823
x_names <- tbl_vars(x)
815824
y_names <- tbl_vars(y)
@@ -881,14 +890,24 @@ join_filter <- function(
881890
dplyr_row_slice(x, idx)
882891
}
883892

884-
check_na_matches <- function(na_matches, ..., error_call = caller_env()) {
893+
check_na_matches <- function(
894+
na_matches,
895+
...,
896+
error_call = caller_env(),
897+
user_env = caller_env(2)
898+
) {
885899
if (isNamespaceLoaded("pkgconfig")) {
886900
conf <- asNamespace("pkgconfig")$get_config("dplyr::na_matches")
887901
if (!is.null(conf)) {
888-
warn(c(
889-
"`dplyr::na_matches` pkgconfig options is now ignored.",
890-
"Please set `na_matches` directly."
891-
))
902+
# No tests for this, don't want to deal with pkgconfig
903+
lifecycle::deprecate_warn(
904+
when = "1.0.0",
905+
what = I("Use of `dplyr::na_matches` pkgconfig options"),
906+
details = "Please set `na_matches` directly.",
907+
always = TRUE,
908+
env = error_call,
909+
user_env = user_env
910+
)
892911
}
893912
}
894913

0 commit comments

Comments
 (0)