Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upkeep: complete the deprecation ofald in favour of abcd #462

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# r2dii.match (development version)

* Complete deprecation of `ald` in favour of `abcd` (#399).

* `match_name` gains argument `join_id` allowing an optional perfect join based on a mutual ID column between `loanbook` and `abcd` inputs, prior to attempting fuzzy matching (#135).

# r2dii.match 0.1.4
Expand Down
4 changes: 1 addition & 3 deletions R/imports.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ globalVariables(
".",
".data",
"alias_abcd",
"alias_ald",
"alias_lbk",
"id_2dii",
"pick",
"rowid",
"score",
"sector",
"sector_abcd",
"sector_ald"
"sector_abcd"
)
)
12 changes: 0 additions & 12 deletions R/match_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
#' `abcd`. If a named character vector, it uses the name as the join column of `loanbook` and
#' the value as the join column of `abcd`.
#' @param ... Arguments passed on to [stringdist::stringsim()].
#' @param ald `r lifecycle::badge('superseded')` `ald` has been superseded by
#' `abcd`.
#'
#' @family main functions
#'
Expand Down Expand Up @@ -135,20 +133,10 @@ match_name <- function(loanbook,
p = 0.1,
overwrite = NULL,
join_id = NULL,
ald = deprecated(),
...) {
restore <- options(datatable.allow.cartesian = TRUE)
on.exit(options(restore), add = TRUE)

if (lifecycle::is_present(ald)) {
lifecycle::deprecate_warn(
"0.1.0 (expected July 2022)",
"match_name(ald)",
"match_name(abcd)"
)
abcd <- ald
}

if (!is.null(join_id)) {
check_join_id(join_id, loanbook, abcd)

Expand Down
23 changes: 0 additions & 23 deletions R/prioritize.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,6 @@ prioritize <- function(data, priority = NULL) {
return(data)
}

if (all(c("sector_ald", "sector_abcd") %in% names(data))) {

rlang::abort(
"too_many_sectors",
message = glue(
"Column `sector_ald` is deprecated as of r2dii.match 0.1.0, please use
`sector_abcd` instead."
)
)

} else if ("sector_ald" %in% names(data)) {

rlang::warn(
"deprecated_name",
message = glue(
"Column `sector_ald` is deprecated as of r2dii.match 0.1.0, please use
`sector_abcd` instead."
)
)

data <- dplyr::rename(data, sector_abcd = "sector_ald")
}

data %>%
check_crucial_names(
c("id_loan", "level", "score", "sector", "sector_abcd")
Expand Down
1 change: 0 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ORCID
PACTA
Winkler
abcd
ald
cjyetman
counterparties
counterparty
Expand Down
4 changes: 0 additions & 4 deletions man/match_name.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading