Skip to content

Commit

Permalink
bmerge coercion support old R (#6635)
Browse files Browse the repository at this point in the history
* do not use .Date which was introduced in R 3.5

* add TODOs

* clean git hickup

* add more todos

* remove wrong todo
  • Loading branch information
ben-schwen authored Dec 5, 2024
1 parent 541f27e commit a36caac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -15031,7 +15031,7 @@ test(2042.3, DT[ , format(mean(date),"%b-%Y"), by=g, verbose=TRUE ], # just thi
# also incidentally fixed #2491
DT = data.table(
Group = c("A", "A", "B", "B", "C", "C"),
Date1 = `class<-`(c(17446.0291040738, 17470.0221205444, 17445.0765226481, # `class<-`() == .Date() to pass on R 3.1.0
Date1 = `class<-`(c(17446.0291040738, 17470.0221205444, 17445.0765226481, # `class<-`() == .Date() to pass on R 3.1.0 # TODO: update to .Date on R 3.5
17456.0360002079, 17440.0230725919, 17451.0572453837), "Date"),
Date2 = `class<-`(c(17459.1561177987, 17451.1086757995, 17449.0820898537,
17443.1175238448, 17461.0463715783, 17448.1033968224), "Date")
Expand Down Expand Up @@ -20620,8 +20620,8 @@ y = data.table(c=1, d=1L)
test(2297.03, y[x, on=.(c == a, d == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a .*no fractions.* to type integer.*Coercing .*c .*no fractions.* to type integer")
test(2297.04, y[x, on=.(d == a, c == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a .*no fractions.* to type integer.*Coercing .*c .*no fractions.* to type integer")
# dates
d_int = .Date(1L)
d_dbl = .Date(1)
d_int = `class<-`(1L, "Date") # TODO: update to .Date on R 3.5
d_dbl = `class<-`(1, "Date")
x = data.table(a=d_int)
y = data.table(c=d_int, d=d_dbl)
test(2297.11, y[x, on=.(c == a, d == a)], data.table(c=d_int, d=d_int))
Expand Down

0 comments on commit a36caac

Please sign in to comment.