From da48b05d9ccf5107750bee9f18fd1fa9e3eee9dc Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sun, 1 Sep 2019 13:44:58 +0200 Subject: [PATCH 1/3] update on join by join field no longer errors, closes #3559 --- NEWS.md | 2 +- inst/tests/tests.Rraw | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 65dfb8f3a8..ced5c3a73d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -253,7 +253,7 @@ 35. `DT[, i-1L, with=FALSE]` would misinterpret the minus sign and return an incorrect result, [#2019](https://github.com/Rdatatable/data.table/issues/2109). Thanks @cguill95 for the report. -36. `DT[id==1, DT2[.SD, on="id"]]` (i.e. joining from `.SD` in `j`) could incorrectly fail in some cases due to `.SD` being locked, [#1926](https://github.com/Rdatatable/data.table/issues/1926). Thanks @franknarf1 for the report and for diligently tracking use cases for almost 3 years! +36. `DT[id==1, DT2[.SD, on="id"]]` (i.e. joining from `.SD` in `j`) could incorrectly fail in some cases due to `.SD` being locked, [#1926](https://github.com/Rdatatable/data.table/issues/1926). Fix also resolves error when doing update on join and joining by factor column [#3559](https://github.com/Rdatatable/data.table/issues/3559). Thanks @franknarf1 and @Henrik-P for the report and for diligently tracking use cases for almost 3 years! 37. `as.IDate.POSIXct` returned `NA` for UTC times before Dec 1901 and after Jan 2038, [#3780](https://github.com/Rdatatable/data.table/issues/3780). Thanks @gschett for the report. diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index 4582e25a67..ffafb0b8f7 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -15864,6 +15864,11 @@ test(2095, any(grepl('override', capture.output(dcast(DT, a~b, fun.aggregate=len # gmean intermediate can overflow integers without warning, #986 test(2096, data.table(a=c(1L,1L), v=c(2e9L, 2e9L))[, mean(v), a], data.table(a=1L, V1=2e9)) +# Error in update join when joining on factor #3559 +d1 <- data.table(fac = factor(letters[1:4]), char = letters[1:4], val = c(1L, NA, 3L, NA)) +d2 <- data.table(fac = factor(letters[1:4]), char = letters[1:4], val = 1:4) +test(2097, d1[is.na(val), val := d2[.SD, x.val, on = .(fac)]], data.table(fac=factor(letters[1:4]), char=letters[1:4], val=1:4)) + ################################### # Add new tests above this line # From 26c30b5f6c6fdaed0c00ba14340bb65a2203bcca Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sun, 1 Sep 2019 13:59:27 +0200 Subject: [PATCH 2/3] another resolved, thanks Henrik for spotting --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index ced5c3a73d..75922b3da8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -253,7 +253,7 @@ 35. `DT[, i-1L, with=FALSE]` would misinterpret the minus sign and return an incorrect result, [#2019](https://github.com/Rdatatable/data.table/issues/2109). Thanks @cguill95 for the report. -36. `DT[id==1, DT2[.SD, on="id"]]` (i.e. joining from `.SD` in `j`) could incorrectly fail in some cases due to `.SD` being locked, [#1926](https://github.com/Rdatatable/data.table/issues/1926). Fix also resolves error when doing update on join and joining by factor column [#3559](https://github.com/Rdatatable/data.table/issues/3559). Thanks @franknarf1 and @Henrik-P for the report and for diligently tracking use cases for almost 3 years! +36. `DT[id==1, DT2[.SD, on="id"]]` (i.e. joining from `.SD` in `j`) could incorrectly fail in some cases due to `.SD` being locked, [#1926](https://github.com/Rdatatable/data.table/issues/1926). Fix also resolves error when doing update on join and joining by factor column [#3559](https://github.com/Rdatatable/data.table/issues/3559) and [#2099](https://github.com/Rdatatable/data.table/issues/2099). Thanks @franknarf1 and @Henrik-P for the report and for diligently tracking use cases for almost 3 years! 37. `as.IDate.POSIXct` returned `NA` for UTC times before Dec 1901 and after Jan 2038, [#3780](https://github.com/Rdatatable/data.table/issues/3780). Thanks @gschett for the report. From be5e411fb0284de4b2e8be2ef0a37d51928376da Mon Sep 17 00:00:00 2001 From: mattdowle Date: Wed, 4 Sep 2019 13:51:02 -0700 Subject: [PATCH 3/3] shortened news item --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 75922b3da8..f64d5e6011 100644 --- a/NEWS.md +++ b/NEWS.md @@ -253,7 +253,7 @@ 35. `DT[, i-1L, with=FALSE]` would misinterpret the minus sign and return an incorrect result, [#2019](https://github.com/Rdatatable/data.table/issues/2109). Thanks @cguill95 for the report. -36. `DT[id==1, DT2[.SD, on="id"]]` (i.e. joining from `.SD` in `j`) could incorrectly fail in some cases due to `.SD` being locked, [#1926](https://github.com/Rdatatable/data.table/issues/1926). Fix also resolves error when doing update on join and joining by factor column [#3559](https://github.com/Rdatatable/data.table/issues/3559) and [#2099](https://github.com/Rdatatable/data.table/issues/2099). Thanks @franknarf1 and @Henrik-P for the report and for diligently tracking use cases for almost 3 years! +36. `DT[id==1, DT2[.SD, on="id"]]` (i.e. joining from `.SD` in `j`) could incorrectly fail in some cases due to `.SD` being locked, [#1926](https://github.com/Rdatatable/data.table/issues/1926), and when updating-on-join with factors [#3559](https://github.com/Rdatatable/data.table/issues/3559) [#2099](https://github.com/Rdatatable/data.table/issues/2099). Thanks @franknarf1 and @Henrik-P for the reports and for diligently tracking use cases for almost 3 years! 37. `as.IDate.POSIXct` returned `NA` for UTC times before Dec 1901 and after Jan 2038, [#3780](https://github.com/Rdatatable/data.table/issues/3780). Thanks @gschett for the report.