timeseriesdb icon indicating copy to clipboard operation
timeseriesdb copied to clipboard

db_ts_store.list with empty list

Open HomoCodens opened this issue 4 years ago • 1 comments

calling db_ts_store.list (i.e. storing a plain list of ts) with an empty list causes an error.

Reason is that the following bit results in a list() instead of a vector of booleans and the following x <- x[is_tsl] fails.

x <- list()
is_tsl <- sapply(x, function(y) inherits(y, c("ts","zoo","xts")))
is_tsl
#> list()

I guess it would be most elegant to somehow pass empty lists by that check as there is already a "length 0 not supported" clause in db_ts_store.tslist which we need not repeat.

HomoCodens avatar Feb 03 '21 09:02 HomoCodens

Actually that "is it a ts check" is redundant, we pass the list off to db_ts_store.tslist which already does it.

HomoCodens avatar May 06 '21 13:05 HomoCodens