-
Notifications
You must be signed in to change notification settings - Fork 1k
Improve merge.data.table error messages for missing keys #6713
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
Changes from all commits
da77d10
ac9d594
214f93a
785a2af
2a1c392
771fbc0
ad66677
ed5bdb1
186cbd5
e849fe6
912d0cd
557825e
8e3e562
e61d65d
c26315d
d31d346
ec58ca2
9c2fefe
8a7a614
bbb9937
b75cfec
8c7ff89
d3f466f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8567,14 +8567,13 @@ DT1 = data.table(a=1) | |
| test(1601.1, merge(DT1, DT1, by="a"), data.table(a=1, key="a")) | ||
| test(1601.2, merge(DT1, DT0, by="a"), | ||
| warning="Input data.table 'y' has no columns.", | ||
| error="Elements listed in `by`") | ||
| error="The following columns listed in `by` are missing from y: [a]") | ||
| test(1601.3, merge(DT0, DT1, by="a"), | ||
| warning="Input data.table 'x' has no columns.", | ||
| error="Elements listed in `by`") | ||
| error="The following columns listed in `by` are missing from x: [a]") | ||
| test(1601.4, merge(DT0, DT0, by="a"), | ||
| warning="Neither of the input data.tables to join have columns.", | ||
| error="Elements listed in `by`") | ||
|
|
||
| error="The following columns listed in `by` are missing from x: [a]") | ||
| # fix for #1549 | ||
| d1 <- data.table(v1=1:2,x=x) | ||
| d2 <- data.table(v1=3:4) | ||
|
|
@@ -13546,14 +13545,14 @@ test(1962.016, merge(DT1, DT2, by.x = 'a', by.y = c('a', 'V')), | |
| test(1962.017, merge(DT1, DT2, by = 'V', by.x = 'a', by.y = 'a'), | ||
| data.table(a = 2:3, V.x = c("a", "a"), V.y = c("b", "b"), key = 'a'), | ||
| warning = 'Supplied both.*argument will be ignored') | ||
| test(1962.018, merge(DT1, DT2, by.x = 'z', by.y = 'a'), | ||
| error = 'Elements listed in `by.x`') | ||
| test(1962.019, merge(DT1, DT2, by.x = 'a', by.y = 'z'), | ||
| error = 'Elements listed in `by.y`') | ||
| test(1962.018, merge(DT1, DT2, by.x='z', by.y='a'), | ||
| error="The following columns listed in `by.x` are missing from x: [z]") | ||
|
||
| test(1962.019, merge(DT1, DT2, by.x='a', by.y='z'), | ||
| error="The following columns listed in `by.y` are missing from y: [z]") | ||
| test(1962.0201, merge(DT1, DT2, by=character(0L)), ans) # was error before PR#5183 | ||
| test(1962.0202, merge(DT1, DT2, by=NULL), ans) # test explicit NULL too as missing() could be used inside merge() | ||
| test(1962.021, merge(DT1, DT2, by = 'z'), | ||
| error = 'must be valid column names in x and y') | ||
| test(1962.021, merge(DT1, DT2, by='z'), | ||
| error='The following columns listed in `by` are missing from x: [z]') | ||
|
|
||
| ## frank.R | ||
| x = c(1, 1, 2, 5, 4, 3, 4, NA, 6) | ||
|
|
@@ -18014,7 +18013,7 @@ test(2230.4, setDF(merge(DT, y, by="k2", incomparables=c(1, NA, 4, 5))), merge(x | |
| test(2230.5, setDF(merge(DT, y, by="k2", incomparables=c(NA, 3, 4, 5))), merge(x, y, by="k2", incomparables=c(NA,3,4,5))) | ||
| test(2230.6, merge(DT, y, by="k2", unk=1), merge(DT, y, by="k2"), warning="Unknown argument 'unk' has been passed.") | ||
| test(2230.7, merge(DT, y, by="k2", NULL, NULL, FALSE, FALSE, FALSE, TRUE, c(".x", ".y"), TRUE, getOption("datatable.allow.cartesian"), NULL, 1L), | ||
| merge(DT, y, by="k2"), warning=c("Supplied both `by` and `by.x/by.y`. `by` argument will be ignored.", "Passed 1 unknown and unnamed arguments.")) | ||
| merge(DT, y, by="k2"), warning=c("Supplied both `by` and `by.x`/`by.y`. `by` argument will be ignored.", "Passed 1 unknown and unnamed arguments.")) | ||
|
|
||
| # weighted.mean GForce optimized, #3977 | ||
| old = options(datatable.optimize=1L) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.