Skip to content

Commit

Permalink
fix s3method dispatch unit test fail (#3351)
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki authored and mattdowle committed Feb 5, 2019
1 parent 5f519dc commit e043dd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ import(stats)
S3method(na.omit, data.table)

S3method(as.data.table, xts)
if(getRversion() >= "3.6.0") {
if (getRversion() >= "3.6.0") {
export(as.xts.data.table) # fails in R-devel if not exported too, but I don't understand why
S3method(xts::as.xts, data.table) # delayed registration (new in R-devel) -- shouldn't this also export as.xts.data.table for us?
} else {
export(as.xts.data.table)
export(as.xts.data.table) # this on some configuration happens to fail as.xts dispatch to dt method #3286
}

# IDateTime support:
Expand Down
3 changes: 1 addition & 2 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -6356,6 +6356,7 @@ if (test_xts) {
test(1465.10, as.data.table(xt), error = 'Input xts object should not')
names(xt)[1L] = 'quantity'
setcolorder(dt, c(3, 1, 2))
if (base::getRversion() < "3.6.0") as.xts = as.xts.data.table # fix for when we cannot register s3method for suggested dependency #3286
test(1465.11, as.xts(dt), error = 'data.table must have a time based')
setcolorder(dt, c(2, 3, 1))
dt[ , char_col := 'a']
Expand All @@ -6364,8 +6365,6 @@ if (test_xts) {
Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = TRUE)
}



# as.data.table.default #969
ar <- array(NA, dim=c(10,4),dimnames = list(NULL,paste("col",1:4,sep="")))
test(1466.1, as.data.table(as.data.frame(ar)), as.data.table(ar)) # array type
Expand Down

0 comments on commit e043dd2

Please sign in to comment.