Skip to content

Commit 88a6661

Browse files
committed
Tweak error message
1 parent a4e6286 commit 88a6661

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

R/pack.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ check_inner_inner_duplicate <- function(x, error_call = caller_env()) {
178178
outers <- split$val
179179

180180
bullets <- map2_chr(inners, outers, function(inner, outer) {
181-
cli::format_inline("{.code {inner}}, across {.code {outer}}.")
181+
cli::format_inline("{.code {inner}}, within {.code {outer}}.")
182182
})
183183
bullets <- set_names(bullets, "i")
184184
bullets <- cli::format_bullets_raw(bullets)
185185
bullets <- set_names(bullets, " ")
186186

187187
message <- c(
188-
"Can't duplicate names across the modified columns.",
188+
"Can't duplicate names within the affected columns.",
189189
x = "These names are duplicated:",
190190
bullets,
191191
i = "Use `names_sep` to disambiguate using the column name.",
@@ -217,7 +217,7 @@ check_outer_inner_duplicate <- function(x, outer, error_call = caller_env()) {
217217
bullets <- set_names(bullets, " ")
218218

219219
message <- c(
220-
"Can't duplicate names between the modified columns and the original data.",
220+
"Can't duplicate names between the affected columns and the original data.",
221221
x = "These names are duplicated:",
222222
bullets,
223223
i = "Use `names_sep` to disambiguate using the column name.",

tests/testthat/_snaps/pack.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
unpack(df, c(x, y))
2828
Condition
2929
Error in `unpack()`:
30-
! Can't duplicate names across the modified columns.
30+
! Can't duplicate names within the affected columns.
3131
x These names are duplicated:
32-
i `b`, across `x` and `y`.
32+
i `b`, within `x` and `y`.
3333
i Use `names_sep` to disambiguate using the column name.
3434
i Or use `names_repair` to specify a repair strategy.
3535

@@ -39,10 +39,10 @@
3939
unpack(df, c(x, y, z))
4040
Condition
4141
Error in `unpack()`:
42-
! Can't duplicate names across the modified columns.
42+
! Can't duplicate names within the affected columns.
4343
x These names are duplicated:
44-
i `a`, across `x` and `z`.
45-
i `b`, across `x`, `y`, and `z`.
44+
i `a`, within `x` and `z`.
45+
i `b`, within `x`, `y`, and `z`.
4646
i Use `names_sep` to disambiguate using the column name.
4747
i Or use `names_repair` to specify a repair strategy.
4848

@@ -52,7 +52,7 @@
5252
unpack(df, d)
5353
Condition
5454
Error in `unpack()`:
55-
! Can't duplicate names between the modified columns and the original data.
55+
! Can't duplicate names between the affected columns and the original data.
5656
x These names are duplicated:
5757
i `a`, from `d`.
5858
i Use `names_sep` to disambiguate using the column name.
@@ -64,7 +64,7 @@
6464
unpack(df, c(d, e, f))
6565
Condition
6666
Error in `unpack()`:
67-
! Can't duplicate names between the modified columns and the original data.
67+
! Can't duplicate names between the affected columns and the original data.
6868
x These names are duplicated:
6969
i `a`, from `d`.
7070
i `b` and `c`, from `f`.

tests/testthat/_snaps/separate-wider.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
separate_wider_regex(df, y, patterns = c(x = ".", value = "."))
150150
Condition
151151
Error in `unpack()`:
152-
! Can't duplicate names between the modified columns and the original data.
152+
! Can't duplicate names between the affected columns and the original data.
153153
x These names are duplicated:
154154
i `x`, from `y`.
155155
i Use `names_sep` to disambiguate using the column name.
@@ -161,10 +161,10 @@
161161
separate_wider_regex(df, c(x, y), patterns = c(gender = ".", value = "."))
162162
Condition
163163
Error in `unpack()`:
164-
! Can't duplicate names across the modified columns.
164+
! Can't duplicate names within the affected columns.
165165
x These names are duplicated:
166-
i `gender`, across `x` and `y`.
167-
i `value`, across `x` and `y`.
166+
i `gender`, within `x` and `y`.
167+
i `value`, within `x` and `y`.
168168
i Use `names_sep` to disambiguate using the column name.
169169
i Or use `names_repair` to specify a repair strategy.
170170

tests/testthat/_snaps/unnest-wider.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
unnest_wider(df, y)
5959
Condition
6060
Error in `unpack()`:
61-
! Can't duplicate names between the modified columns and the original data.
61+
! Can't duplicate names between the affected columns and the original data.
6262
x These names are duplicated:
6363
i `x`, from `y`.
6464
i Use `names_sep` to disambiguate using the column name.
@@ -70,9 +70,9 @@
7070
unnest_wider(df, c(y, z))
7171
Condition
7272
Error in `unpack()`:
73-
! Can't duplicate names across the modified columns.
73+
! Can't duplicate names within the affected columns.
7474
x These names are duplicated:
75-
i `a`, across `y` and `z`.
75+
i `a`, within `y` and `z`.
7676
i Use `names_sep` to disambiguate using the column name.
7777
i Or use `names_repair` to specify a repair strategy.
7878

tests/testthat/_snaps/unnest.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
unnest(df, y)
4141
Condition
4242
Error in `unpack()`:
43-
! Can't duplicate names between the modified columns and the original data.
43+
! Can't duplicate names between the affected columns and the original data.
4444
x These names are duplicated:
4545
i `x`, from `y`.
4646
i Use `names_sep` to disambiguate using the column name.
@@ -52,9 +52,9 @@
5252
unnest(df, c(x, y))
5353
Condition
5454
Error in `unpack()`:
55-
! Can't duplicate names across the modified columns.
55+
! Can't duplicate names within the affected columns.
5656
x These names are duplicated:
57-
i `a`, across `x` and `y`.
57+
i `a`, within `x` and `y`.
5858
i Use `names_sep` to disambiguate using the column name.
5959
i Or use `names_repair` to specify a repair strategy.
6060

0 commit comments

Comments
 (0)