You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be by design, but I couldn't find an explicit mention of it in NEWS, issue reports or elsewhere.
We're trying to upgrade data.table from 1.11.8 to 1.13.6, and some of our tests break on code that simplifies to this:
Interesting, thanks @OfekShilon for tracking this. Could you share some more info like which R versions you used? I see R 4.0.3, and what was the other one?
@jangorecki We're upgrading from R3.4, where this code passes. So while this isn't a data.table regression, I think this code really shouldn't fail - addition of "AsIs" to a class attribute shouldn't count as a class change. This is the relevant code.
What do you think?
@MichaelChirico Maybe simply remove AsIs from the class attributes before comparing them with R_compute_identical? A bit ad-hoc, but feels safe.
The unified column probably should have the AsIs class appended back, if it were initially present in any summand.
Ran the mentioned code with R3.4 with fill=FALSE Got similar to R4 error message:
> rbindlist(d, fill=FALSE)
Error in rbindlist(d, fill = F) :
Class attributes at column 2 of input list at position 2 does not match with column 2 of input list at position 1. Coercion of objects of class 'factor' alone is handled internally by rbind/rbindlist at the moment.
Activity
OfekShilon commentedon Mar 14, 2021
This seems due to an R upgrade, not data.table upgrade.
jangorecki commentedon Mar 14, 2021
Interesting, thanks @OfekShilon for tracking this. Could you share some more info like which R versions you used? I see R 4.0.3, and what was the other one?
OfekShilon commentedon Mar 14, 2021
@jangorecki We're upgrading from R3.4, where this code passes. So while this isn't a data.table regression, I think this code really shouldn't fail - addition of "AsIs" to a class attribute shouldn't count as a class change.
This is the relevant code.
What do you think?
[-]`rbindlist` breaking change, with AsIs[/-][+]`rbindlist` fails in the presence of AsIs[/+]MichaelChirico commentedon Mar 14, 2021
Maybe we should
as.data.tablenon-data.tableinputs torbindlist, andas.data.table.data.frameshould "force"AsIscolumns?Actually this raises another bug...
OfekShilon commentedon Mar 15, 2021
@MichaelChirico Maybe simply remove
AsIsfrom the class attributes before comparing them withR_compute_identical? A bit ad-hoc, but feels safe.The unified column probably should have the
AsIsclass appended back, if it were initially present in any summand.liorso commentedon Mar 15, 2021
Ran the mentioned code with R3.4 with fill=FALSE Got similar to R4 error message:
Why does the fill argument change the
typelogic?OfekShilon commentedon Mar 18, 2021
Note that
base::rbinddoes behave as expected:I believe
rbindlistshould conform.add AsIs #4934
Rbind allow binding of different class attributes (#5446)