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: match_name gains more informative warn and error messages with bad sector classifications #463

Merged
merged 2 commits into from
Mar 22, 2024
Merged
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
23 changes: 15 additions & 8 deletions R/add_sector_and_borderline.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,27 @@
abort_all_sec_classif_unknown <- function(column, known) {
abort(
class = "all_sec_classif_unknown",
message = glue(
"Some `{column}` must be known, i.e. one of:
{collapse2(known)}"
)
message = c(
glue("Some `{column}` must be known, i.e. one of: {collapse2(known)}"),
"i" = "If you wish to request a new sector classification system, please create an issue here:",
"*" = "https://github.com/RMI-PACTA/r2dii.data/issues",
"i" = "Or contact the PACTA team here:",
"*" = "[email protected]"

Check warning on line 98 in R/add_sector_and_borderline.R

View check run for this annotation

Codecov / codecov/patch

R/add_sector_and_borderline.R#L93-L98

Added lines #L93 - L98 were not covered by tests
),
use_cli_format = TRUE

Check warning on line 100 in R/add_sector_and_borderline.R

View check run for this annotation

Codecov / codecov/patch

R/add_sector_and_borderline.R#L100

Added line #L100 was not covered by tests
)
}

warn_some_sec_classif_unknown <- function(column, unknown) {
warn(
class = "some_sec_classif_unknown",
message = glue(
"Some `{column}` are unknown:
{collapse2(unknown)}"
)
message = c(
glue("Some `{column}` are unknown:{collapse2(unknown)}"),
"i" = "If you wish to request a new sector classification system, please create an issue here:",
"*" = "https://github.com/RMI-PACTA/r2dii.data/issues",
"i" = "Or contact the PACTA team here:",
"*" = "[email protected]"

Check warning on line 112 in R/add_sector_and_borderline.R

View check run for this annotation

Codecov / codecov/patch

R/add_sector_and_borderline.R#L107-L112

Added lines #L107 - L112 were not covered by tests
)
)

invisible(column)
Expand Down
Loading