Skip to content

After passing a forecast object through the add_coverage function, it is re-transformed into a data.table. #559

@toshiakiasakura

Description

@toshiakiasakura

When I work on this package, I found the following bug.

As illustrated in the example, if I ran the following code, I obtained the "forecast_quantile" object.

example_quantile %>%
  set_forecast_unit(c("location", "target_end_date", "target_type", "horizon", "model")) %>%
  as_forecast() %>%
  class()
#> 'forecast_quantile''data.table''data.frame'

However, if I check class after passing through the add_coverage function, the object suddenly becomes a data.table.

example_quantile %>%
  set_forecast_unit(c("location", "target_end_date", "target_type", "horizon", "model")) %>%
  as_forecast() %>%
  add_coverage() %>% 
  class()
#> 'data.table''data.frame'

Expected outcome would be 'forecast_quantile''data.table''data.frame'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions