When using a data frame or a tsibble, if the date column contains hourly data that is a datetime object, nixtlar will transform said column to characters. However, dates of the form yyyy-mm-dd 00:00:00 are converted to yyyy-mm-dd. This generates an error.
Reproducible example
library(nixtlar)
nixtlar::nixtla_set_api_key("NIXTLA_API_KEY")
df <- nixtlar::electricity
nixtlar::nixtla_client_forecast(df, h=8, id_col="unique_id") # this works fine
df$ds <- as.POSIXct(df$ds, format = "%Y-%m-%d %H:%M:%S") # this is the data type the user had
df#ds <- as.character(df$ds) # this is what `nixtlar` is doing in the background
head(df)
nixtlar::nixtla_client_forecast(df, h=8, id_col="unique_id) # this returns an error
Description
A user reported the following issue:
When using a data frame or a
tsibble
, if the date column contains hourly data that is a datetime object,nixtlar
will transform said column to characters. However, dates of the formyyyy-mm-dd 00:00:00
are converted toyyyy-mm-dd
. This generates an error.Reproducible example