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
Using as.data.table.data.frame() on a data.frame which inherits from another class leads to an infinite recursion. This seems to have been introduced in #6865 and also came up in #6874. The issue is caused in line 218 in as.data.table.R:
if (!identical(class(x), "data.frame")) return(as.data.table(as.data.frame(x), keep.rownames=keep.rownames, key=key, ...))
# Minimal reproducible example (not executed as this breaks reprex)
This was indirectly filed to me as a bug report by someone who uses one of my packages (which uses as.data.table()). I agree that this is their fault, but it still can be quite cumbersome to debug for packages using data.table especially as this simply leads to a C stack error.
Activity
MichaelChirico commentedon Mar 21, 2025
as noted in #6874 I think this is the fault of a bug in your as.data.frame method. anyway this is a duplicate.
beckerbenj commentedon Mar 21, 2025
This was indirectly filed to me as a bug report by someone who uses one of my packages (which uses
as.data.table()). I agree that this is their fault, but it still can be quite cumbersome to debug for packages usingdata.tableespecially as this simply leads to a C stack error.