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

Hourly data vanishing when converted to character format #8

Open
MMenchero opened this issue Jul 3, 2024 · 0 comments
Open

Hourly data vanishing when converted to character format #8

MMenchero opened this issue Jul 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@MMenchero
Copy link
Collaborator

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 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 
@MMenchero MMenchero changed the title Vanishing dates when specifying hour, minutes, and seconds Hourly data vanishing when converted to character format Jul 3, 2024
@MMenchero MMenchero added the bug Something isn't working label Jul 3, 2024
@MMenchero MMenchero self-assigned this Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant