Skip to content
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

bug in merge.data.table when one column is difftime #5589

Closed
adamaltmejd opened this issue Feb 7, 2023 · 2 comments
Closed

bug in merge.data.table when one column is difftime #5589

adamaltmejd opened this issue Feb 7, 2023 · 2 comments
Milestone

Comments

@adamaltmejd
Copy link

With data.table_1.14.7.

    dt1 <- data.table(a = as.Date(c("2022-01-01", "2022-01-02")), b = c(1,1), t = as.difftime(1, units = "days"))
    dt2 <- data.table(a = as.Date(c("2022-01-01")), c = c(1))
    dt3 <- data.table(a = as.Date(c("2022-01-01", "2022-01-03")), c = c(1,1))
> merge(dt1, dt2, all = T)
Key: <a>
            a     b          t     c
       <Date> <num> <difftime> <num>
1: 2022-01-01     1     1 days     1
2: 2022-01-02     1     1 days    NA
> merge(dt1, dt3, all = T)
Error in rbindlist(l, use.names, fill, idcol) : 
  Class attribute on column 4 of item 2 does not match with column 4 of item 1.

Of course, neither item 1 or item 2 have 4 columns.

@ben-schwen
Copy link
Member

Looks like a duplicate to #5309 or #5542 and should be resolved once #5446 is merged.

This bug appeared when we changed merge in #5263 to use rbind(..., use.names=FALSE, fill=TRUE) instead of manually filling the binding objects.

@jangorecki jangorecki modified the milestones: 1.14.6, 1.14.7 Feb 8, 2023
@jangorecki jangorecki modified the milestones: 1.14.9, 1.15.0 Oct 29, 2023
@jangorecki jangorecki modified the milestones: 1.15.0, 1.15.1 Nov 6, 2023
@ben-schwen
Copy link
Member

This was resolved by #5468 (checked now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants