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

Per #269, updated the messaging in 'xportr_order()` to fix a mistatem… #279

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# xportr (development version)

* Updated order messaging to clarify some messaging when all data in dataset is
found in the specification. (#269)

* `"hms"` was added to the default value of the `xportr.numeric_types` option.
This ensures that `{xportr}` works smoothly with variables created by
`admiral::derive_vars_dtm_to_tm()`. (#271)
Expand Down
2 changes: 1 addition & 1 deletion R/messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ var_ord_msg <- function(reordered_vars, moved_vars, verbose) {
)
xportr_logger(message, verbose)
} else {
cli_h2("All variables in specification file are in dataset")
cli_h2("All variables in dataset are found in `metadata`")
}

if (length(reordered_vars) > 0) {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ test_that("metadata Test 29: Variable ordering messaging is correct", {
# Metadata versions
xportr_metadata(df, df_meta, domain = "df", verbose = "message") %>%
xportr_order() %>%
expect_message("All variables in specification file are in dataset") %>%
expect_message("All variables in dataset are found in `metadata`") %>%
expect_condition("4 reordered in dataset") %>%
expect_message("Variable reordered in `.df`: `a`, `b`, `c`, and `d`")

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-order.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ test_that("order Test 8: Variable ordering messaging is correct", {
local_cli_theme()
suppressMessages(
xportr_order(df, df_meta, verbose = "message", domain = "df") %>%
expect_message("All variables in specification file are in dataset") %>%
expect_message("All variables in dataset are found in `metadata`") %>%
expect_condition("4 reordered in dataset") %>%
expect_message("Variable reordered in `.df`: `a`, `b`, `c`, and `d`")
)
Expand Down Expand Up @@ -172,13 +172,13 @@ test_that("order Test 10: Gets warning when metadata has multiple rows with same
# Checks that message appears when xportr.domain_name is invalid
suppressMessages(multiple_vars_in_spec_helper(xportr_order) %>%
# expect_message() are being caught to provide clean test without output #nolint
expect_message("All variables in specification file are in dataset") %>%
expect_message("All variables in dataset are found in `metadata`") %>%
expect_message("All variables in dataset are ordered"))

# Checks that message doesn't appear when xportr.domain_name is valid
suppressMessages(multiple_vars_in_spec_helper2(xportr_order) %>%
# expect_message() are being caught to provide clean test without output #nolint
expect_message("All variables in specification file are in dataset") %>%
expect_message("All variables in dataset are found in `metadata`") %>%
expect_message("All variables in dataset are ordered"))
})

Expand Down
Loading