Running 'testthat.R' [13s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(finnts)
  Loading required package: modeltime
  > 
  > test_check("finnts")
  Finn Submission Info
  • Experiment Name: finn_fcst
  • Run Name: finn_fcst-20240209T081903Z
  
  ℹ Prepping Data
  ✖ Prepping Data [3.3s]
  
  [ FAIL 1 | WARN 4 | SKIP 0 | PASS 0 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-forecast_time_series.R:23:1'): (code run outside of `test_that()`) ──
  Error in `{
      combo <- x %>% dplyr::pull(Combo)
      return_tbl <- tibble::tibble(Combo = combo, Combo_Hash = hash_data(combo))
      initial_prep_combo_tbl <- filtered_initial_prep_tbl %>% dplyr::filter(Combo == 
          combo) %>% dplyr::collect()
      xregs_future_tbl <- get_xregs_future_values_tbl(initial_prep_combo_tbl, 
          external_regressors, hist_end_date, forecast_approach)
      if (length(colnames(xregs_future_tbl)) > 2) {
          xregs_future_list <- xregs_future_tbl %>% dplyr::select(-Date, 
              -Combo) %>% colnames()
      }
      else {
          xregs_future_list <- NULL
      }
      initial_tbl <- initial_prep_combo_tbl %>% dplyr::filter(Combo == 
          combo) %>% dplyr::select(Combo, Date, Target, tidyselect::all_of(setdiff(external_regressors, 
          xregs_future_list))) %>% dplyr::group_by(Combo) %>% timetk::pad_by_time(Date, 
          .by = date_type, .pad_value = ifelse(clean_missing_values, 
              NA, 0), .end_date = hist_end_date) %>% timetk::pad_by_time(Date, 
          .by = date_type, .pad_value = 0, .start_date = hist_start_date, 
          .end_date = hist_end_date) %>% timetk::future_frame(Date, 
          .length_out = forecast_horizon, .bind_data = TRUE) %>% 
          dplyr::ungroup() %>% dplyr::left_join(xregs_future_tbl, 
          by = c("Combo", "Date")) %>% clean_outliers_missing_values(clean_outliers, 
          clean_missing_values, get_frequency_number(date_type), 
          external_regressors) %>% dplyr::mutate_if(is.numeric, 
          list(~replace(., is.infinite(.), NA))) %>% dplyr::mutate_if(is.numeric, 
          list(~replace(., is.nan(.), NA))) %>% dplyr::mutate_if(is.numeric, 
          list(~replace(., is.na(.), 0))) %>% dplyr::mutate(Target = ifelse(Date > 
          hist_end_date, NA, Target))
      if (box_cox) {
          box_cox_tbl <- initial_tbl %>% apply_box_cox()
          initial_tbl <- box_cox_tbl$data
          return_tbl <- return_tbl %>% dplyr::left_join(box_cox_tbl$diff_info, 
              by = "Combo")
      }
      if (stationary) {
          stationary_tbl <- initial_tbl %>% make_stationary()
          initial_tbl <- stationary_tbl$data
          return_tbl <- return_tbl %>% dplyr::left_join(stationary_tbl$diff_info, 
              by = "Combo")
      }
      date_features <- initial_tbl %>% dplyr::select(Date) %>% 
          dplyr::mutate(Date_Adj = Date %m+% months(fiscal_year_start - 
              1), Date_day_month_end = ifelse(lubridate::day(Date_Adj) == 
              lubridate::days_in_month(Date_Adj), 1, 0)) %>% timetk::tk_augment_timeseries_signature(Date_Adj) %>% 
          dplyr::select(!tidyselect::matches(get_date_regex(date_type)), 
              -Date_Adj, -Date)
      names(date_features) <- stringr::str_c("Date_", names(date_features))
      initial_tbl <- initial_tbl %>% cbind(date_features)
      if (is.null(recipes_to_run)) {
          run_all_recipes_override <- FALSE
      }
      else if ("all" %in% recipes_to_run) {
          run_all_recipes_override <- TRUE
      }
      else {
          run_all_recipes_override <- FALSE
      }
      if (is.null(recipes_to_run) | "R1" %in% recipes_to_run | 
          run_all_recipes_override) {
          R1 <- initial_tbl %>% multivariate_prep_recipe_1(external_regressors, 
              xregs_future_values_list = xregs_future_list, get_fourier_periods(fourier_periods, 
                  date_type), get_lag_periods(lag_periods, date_type, 
                  forecast_horizon), get_rolling_window_periods(rolling_window_periods, 
                  date_type), hist_end_date, date_type) %>% dplyr::mutate(Target = base::ifelse(Date > 
              hist_end_date, NA, Target))
          write_data(x = R1, combo = combo, run_info = run_info, 
              output_type = "data", folder = "prep_data", suffix = "-R1")
      }
      if ((is.null(recipes_to_run) & date_type %in% c("month", 
          "quarter", "year")) | "R2" %in% recipes_to_run | run_all_recipes_override) {
          R2 <- initial_tbl %>% multivariate_prep_recipe_2(external_regressors, 
              xregs_future_values_list = xregs_future_list, get_fourier_periods(fourier_periods, 
                  date_type), get_lag_periods(lag_periods, date_type, 
                  forecast_horizon), get_rolling_window_periods(rolling_window_periods, 
                  date_type), date_type, forecast_horizon, hist_end_date) %>% 
              dplyr::mutate(Target = base::ifelse(Date > hist_end_date, 
                  NA, Target))
          write_data(x = R2, combo = combo, run_info = run_info, 
              output_type = "data", folder = "prep_data", suffix = "-R2")
      }
      return(return_tbl)
  }`: task 1 failed - "object 'guide_level' is not exported by 'namespace:distributional'"
  Backtrace:
      ▆
   1. ├─finnts::forecast_time_series(...) at test-forecast_time_series.R:23:1
   2. │ └─finnts::prep_data(...)
   3. │   ├─... %>% base::suppressPackageStartupMessages()
   4. │   └─... %op% ...
   5. │     └─e$fun(obj, substitute(ex), parent.frame(), e$data)
   6. └─base::suppressPackageStartupMessages(.)
   7.   └─base::withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
  
  [ FAIL 1 | WARN 4 | SKIP 0 | PASS 0 ]
  Error: Test failures
  Execution halted