-
Notifications
You must be signed in to change notification settings - Fork 998
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
Inconsistent replacement of list column element with NULL in table with 1 row #5558
Comments
I can do this: library(data.table)
DT1=data.table(L=list("A"),i=1)
DT1[, `:=`(L = list(NULL))] that works, but oddly not
which should be identical per |
The fix here, #6167, caused a regression: #6740 / markfairbanks/tidytable#831. In line with the GOVERNANCE rules I think we should revert #6167, at least for now and at least by default: Line 17 in 3a7ec2d
If we decide the new approach landed on in #6167 is preferable, or that it unlocks a behavior that was previously impossible, we should re-introduce #6167 gradually with a deprecation cycle. Here's my proposal:
|
related: #6732 |
sure let's revert. |
FYI, I'll plan to do a cherry-pick style revert instead of a simple clean one -- I think the test suite in the PR is really great, and of utility even if the exact behavior tested needs to change slightly. |
In base R data.frame we can replace an element of a list column with NULL via:
However in data.table, doing that results in deleting the list column entirely:
Request: can we make the above code do a replacement (like base R data.frame) instead of deleting the column?
The above issue is confusing because it is inconsistent with how data table handles replacement in tables with more than one row:
Actually, we can do the replacement (inconsistently) in data.table via
The text was updated successfully, but these errors were encountered: