Skip to content

Commit 42a80b3

Browse files
NEWS position
1 parent 51666c4 commit 42a80b3

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

NEWS.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,25 @@ rowwiseDT(
133133

134134
19. Grouped queries on keyed tables no longer return an incorrectly keyed result if the _ad hoc_ `by=` list has some function call (in particular, a function which happens to return a strictly decreasing function of the keys), e.g. `by=.(a = rev(a))`, [#5583](https://github.com/Rdatatable/data.table/issues/5583). Thanks @AbrJA for the report and @MichaelChirico for the fix.
135135

136+
20. Assigning `list(NULL)` to a list column now replaces the column with `list(NULL)`, instead of deleting the column [#5558](https://github.com/Rdatatable/data.table/issues/5558). This behavior is now consistent with base `data.frame`. Thanks @tdhock for the report and @joshhwuu for the fix. This is due to a fundamental ambiguity from both allowing list columns _and_ making the use of `list()` to wrap `j=` arguments optional. We think that the code behaves as expected in all cases now. See the below for some illustration:
137+
138+
```r
139+
DT = data.table(L=list(1L), i=2L, c='a')
140+
DT[, i := NULL] # delete i
141+
DT[, L := NULL] # delete L
142+
143+
DT[, i := list(NULL)] # delete i
144+
DT[, L := list(NULL)] # assignment: identical(DT$L, list(NULL))
145+
146+
DT[, i := .(3L)] # assignment: identical(DT$i, 3L)
147+
DT[, L := .(list(NULL))] # assignment: identical(DT$L, list(NULL))
148+
149+
DT[, c('L', 'i') := list(NULL, NULL)] # delete L,i
150+
DT[, c('L', 'i') := list(list(NULL), 3L)] # assignment: identical(DT$L, list(NULL)), identical(DT$i, 3L)
151+
DT[, c('L', 'i') := list(NULL, 3L)] # delete L, assign to i
152+
DT[, c('L', 'i') := list(list(NULL), NULL)] # assign to L, delete i
153+
```
154+
136155
## NOTES
137156

138157
1. There is a new vignette on joins! See `vignette("datatable-joins")`. Thanks to Angel Feliz for authoring it! Feedback welcome. This vignette has been highly requested since 2017: [#2181](https://github.com/Rdatatable/data.table/issues/2181).
@@ -300,25 +319,6 @@ rowwiseDT(
300319

301320
14. Passing functions programmatically with `env=` doesn't produce an opaque error, e.g. `DT[, f(b), env = list(f=sum)]`, [#6026](https://github.com/Rdatatable/data.table/issues/6026). Note that it's much better to pass functions like `f="sum"` instead. Thanks to @MichaelChirico for the bug report and fix.
302321

303-
10. Assigning `list(NULL)` to a list column now replaces the column with `list(NULL)`, instead of deleting the column [#5558](https://github.com/Rdatatable/data.table/issues/5558). This behavior is now consistent with base `data.frame`. Thanks @tdhock for the report and @joshhwuu for the fix. This is due to a fundamental ambiguity from both allowing list columns _and_ making the use of `list()` to wrap `j=` arguments optional. We think that the code behaves as expected in all cases now. See the below for some illustration:
304-
305-
```r
306-
DT = data.table(L=list(1L), i=2L, c='a')
307-
DT[, i := NULL] # delete i
308-
DT[, L := NULL] # delete L
309-
310-
DT[, i := list(NULL)] # delete i
311-
DT[, L := list(NULL)] # assignment: identical(DT$L, list(NULL))
312-
313-
DT[, i := .(3L)] # assignment: identical(DT$i, 3L)
314-
DT[, L := .(list(NULL))] # assignment: identical(DT$L, list(NULL))
315-
316-
DT[, c('L', 'i') := list(NULL, NULL)] # delete L,i
317-
DT[, c('L', 'i') := list(list(NULL), 3L)] # assignment: identical(DT$L, list(NULL)), identical(DT$i, 3L)
318-
DT[, c('L', 'i') := list(NULL, 3L)] # delete L, assign to i
319-
DT[, c('L', 'i') := list(list(NULL), NULL)] # assign to L, delete i
320-
```
321-
322322
## NOTES
323323

324324
1. `transform()` method for data.table sped up substantially when creating new columns on large tables. Thanks to @OfekShilon for the report and PR. The implemented solution was proposed by @ColeMiller1.

0 commit comments

Comments
 (0)