tidyverts / fabletools

General fable features useful for extension packages
http://fabletools.tidyverts.org/
89 stars 31 forks source link

dplyr 1.0.0 #181

Closed romainfrancois closed 4 years ago

romainfrancois commented 4 years ago

We're seeing this when checking the reverse dependencies of dplyr 1.0.0 :

[master*] 274.1 MiB ❯ revdepcheck::revdep_details(".", "fabletools")
══ Reverse dependency check ════════════════════════════════ fabletools 0.1.2 ══

Status: BROKEN

── Still failing

✖ checking package dependencies ... NOTE

── Newly failing

✖ checking examples ... ERROR
✖ checking tests ...

── Before ──────────────────────────────────────────────────────────────────────
❯ checking package dependencies ... NOTE
  Package suggested but not available for checking: ‘feasts’

0 errors ✔ | 0 warnings ✔ | 1 note ✖

── After ───────────────────────────────────────────────────────────────────────
❯ checking examples ... ERROR
  Running examples in ‘fabletools-Ex.R’ failed
  The error most likely occurred in:

  > ### Name: accuracy
  > ### Title: Evaluate accuracy of a forecast or model
  > ### Aliases: accuracy accuracy.mdl_df accuracy.fbl_ts
  >
  > ### ** Examples
  >
  > if (requireNamespace("fable", quietly = TRUE)) {
  + library(fable)
  + library(tsibble)
  + library(tsibbledata)
  + library(dplyr)
  +
  + fit <- aus_production %>%
  +   filter(Quarter < yearquarter("2006 Q1")) %>%
  +   model(ets = ETS(log(Beer) ~ error("M") + trend("Ad") + season("A")))
  +
  + # In-sample training accuracy does not require extra data provided.
  + accuracy(fit)
  +
  + # Out-of-sample forecast accuracy requires the future values to compare with.
  + # All available future data will be used, and a warning will be given if some
  + # data for the forecast window is unavailable.
  + fc <- fit %>%
  +   forecast(h = "5 years")
  + fc %>%
  +   accuracy(aus_production)
  +
  + # It is also possible to compute interval and distributional measures of
  + # accuracy for models and forecasts which give forecast distributions.
  + fc %>%
  +   accuracy(
  +     aus_production,
  +     measures = list(interval_accuracy_measures, distribution_accuracy_measures)
  +   )
  + }

  Attaching package: ‘dplyr’

  The following object is masked from ‘package:tsibble’:

      id

  The following objects are masked from ‘package:stats’:

      filter, lag

  The following objects are masked from ‘package:base’:

      intersect, setdiff, setequal, union

  Error: Input must be a vector, not a `fcdist` object.
  Backtrace:
       █
    1. ├─fit %>% forecast(h = "5 years")
    2. │ ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
    3. │ └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
    4. │   └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
    5. │     └─`_fseq`(`_lhs`)
    6. │       └─magrittr::freduce(value, `_function_list`)
    7. │         ├─base::withVisible(function_list[[k]](value))
    8. │         └─function_list[[k]](value)
    9. │           ├─fabletools::forecast(., h = "5 years")
   10. │           └─fabletools:::forecast.mdl_df(., h = "5 years")
   11. │             ├─base::suppressWarnings(...)
   12. │             │ └─base::withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
   13. │             └─fabletools:::unnest_tsbl(...)
   14. │               └─fabletools:::unnest_tbl(.data, tsbl_col)
   15. │                 └─fable
  Execution halted

❯ checking tests ...
  See below...

❯ checking package dependencies ... NOTE
  Package suggested but not available for checking: ‘feasts’

── Test failures ───────────────────────────────────────────────── testthat ────

> library(testthat)
> library(dplyr)

Attaching package: 'dplyr'

The following object is masked from 'package:testthat':

    matches

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

>
> test_check("fabletools")
Loading required package: fabletools
Error: Input must be a vector, not a `fcdist` object.
Backtrace:
     █
  1. ├─testthat::test_check("fabletools")
  2. │ └─testthat:::test_package_dir(...)
  3. │   └─testthat::test_dir(...)
  4. │     └─testthat::source_test_setup(path, env)
  5. │       └─testthat::source_dir(path, "^setup.*\\.[rR]$", env = env, wrap = FALSE)
  6. │         └─base::lapply(files, source_file, env = env, chdir = chdir, wrap = wrap)
  7. │           └─testthat:::FUN(X[[i]], ...)
  8. │             └─base::eval(exprs, env)
  9. │               └─base::eval(exprs, env)
 10. │                 └─mbl %>% forecast(h = 12) setup-data.R:14:0
 11. │                   ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
 12. │                   └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
 13. │                     └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
 14. │                       └─fabletools:::`_fseq`(`_lhs`)
Execution halted

2 errors ✖ | 0 warnings ✔ | 1 note ✖

and this when running the tests :

==> devtools::test()

Loading fabletools
Testing fabletools
✓ |  OK F W S | Context
x |  16 1     | test-accuracy [0.9 s]
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
test-accuracy.R:52: error: Out-of-sample accuracy
Can't determine index and please specify argument `index`.
Backtrace:
  1. testthat::expect_warning(accuracy(fbl, head(us_deaths)), "12 observations are missing between 1978 Jan and 1978 Dec") tests/testthat/test-accuracy.R:52:2
  7. fabletools::accuracy.fbl_ts(fbl, head(us_deaths)) R/accuracy.R:185:2
  9. dplyr:::groups.data.frame(object) /Users/romainfrancois/git/tidyverse/dplyr/R/group_data.R:121:2
 14. dplyr:::group_vars.data.frame(x) /Users/romainfrancois/git/tidyverse/dplyr/R/group_data.R:111:2
 17. dplyr:::group_data.data.frame(x) /Users/romainfrancois/git/tidyverse/dplyr/R/group_data.R:39:2
 20. fabletools::`[.fbl_ts`(.data, 0) /Users/romainfrancois/git/tidyverse/dplyr/R/group_data.R:44:2
 22. fabletools::as_fable.tbl_df(...) R/fable.R:38:2
 25. tsibble:::as_tsibble.tbl_df(x, ...)
 26. tsibble::build_tsibble(...)
 27. tsibble:::validate_index(tbl, !!qindex)
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✓ |  26       | test-broom [0.7 s]
✓ |   5   2   | test-combination [1.0 s]
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
test-combination.R:19: warning: Combination modelling
`progress_estimated()` is deprecated as of dplyr 1.0.0.

test-combination.R:32: warning: Combination modelling
`progress_estimated()` is deprecated as of dplyr 1.0.0.
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✓ |   0     1 | test-decomposition-model
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
test-decomposition-model.R:5: skip: Decomposition modelling
Reason: feasts cannot be loaded
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✓ |  19       | test-distributions
x |   4 1     | test-fable
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
test-fable.R:32: error: fable dplyr verbs
`vars` must be a character vector
Backtrace:
  1. testthat::expect_equivalent(...) tests/testthat/test-fable.R:32:2
  5. base::rbind(fbl_multi[1:12, ], fbl_multi[13:24, ])
  6. fabletools:::rbind(deparse.level, ...)
 11. base::rbind(...)
 12. tsibble:::rbind(deparse.level, ...)
 13. tsibble:::retain_tsibble(x, key(data), index(data))
 14. tsibble:::duplicated_key_index(data, key, index)
 15. dplyr::grouped_df(as_tibble(data), key)
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✓ |   7       | test-features
x |   0 2     | test-generate
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
test-generate.R:6: error: generate
`vars` must be a character vector
Backtrace:
  9. generics::generate(.)
 11. fabletools::map2(...) R/generate.R:39:2
 12. base::mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE) R/compat-purrr.R:54:2
 14. fabletools::generate.mdl_ts(...)
  5. fabletools::map(...)
 13. fabletools::invoke("rbind", .)
 26. tsibble:::rbind(deparse.level, ...)
 27. tsibble:::retain_tsibble(x, key(data), index(data))
 28. tsibble:::duplicated_key_index(data, key, index)
 29. dplyr::grouped_df(as_tibble(data), key)

test-generate.R:31: error: generate seed setting
`vars` must be a character vector
Backtrace:
  1. testthat::expect_equal(...) tests/testthat/test-generate.R:31:2
 10. generics::generate(., seed = seed)
 14. fabletools::map2(...) R/generate.R:39:2
 15. base::mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE) R/compat-purrr.R:54:2
 17. fabletools::generate.mdl_ts(...)
  6. fabletools::map(...)
 14. fabletools::invoke("rbind", .)
 29. tsibble:::rbind(deparse.level, ...)
 30. tsibble:::retain_tsibble(x, key(data), index(data))
 31. tsibble:::duplicated_key_index(data, key, index)
 32. dplyr::grouped_df(as_tibble(data), key)
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
x |  56 1   1 | test-graphics [3.6 s]
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
test-graphics.R:227: error: autoplot.fbl_ts()
Can't determine index and please specify argument `index`.
Backtrace:
  1. ggplot2::autoplot(fbl_complex, lung_deaths_long, level = 95) tests/testthat/test-graphics.R:227:2
  2. fabletools::autoplot.fbl_ts(fbl_complex, lung_deaths_long, level = 95) /Users/romainfrancois/git/revdep/ggplot2/R/autoplot.r:13:2
 16. dplyr:::semi_join.data.frame(data, object, by = key_vars(data))
 17. dplyr:::join_filter(x, y, by = by, type = "semi", na_matches = na_matches) /Users/romainfrancois/git/tidyverse/dplyr/R/join.r:235:2
 21. dplyr::tbl_vars(y) /Users/romainfrancois/git/tidyverse/dplyr/R/join.r:360:2
 25. dplyr:::group_vars.data.frame(x) /Users/romainfrancois/git/tidyverse/dplyr/R/group_data.R:111:2
 28. dplyr:::group_data.data.frame(x) /Users/romainfrancois/git/tidyverse/dplyr/R/group_data.R:39:2
 31. fabletools::`[.fbl_ts`(.data, 0) /Users/romainfrancois/git/tidyverse/dplyr/R/group_data.R:44:2
 33. fabletools::as_fable.tbl_df(...) R/fable.R:38:2
 36. tsibble:::as_tsibble.tbl_df(x, ...)
 37. tsibble::build_tsibble(...)
 38. tsibble:::validate_index(tbl, !!qindex)

test-graphics.R:324: skip: autoplot_dcmp_ts()
Reason: feasts cannot be loaded
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✓ |   1       | test-hilo.R
✓ |   1       | test-interpolate.R
✓ |  31       | test-mable.R [0.2 s]
✓ |   4       | test-multivariate.R
✓ |  33       | test-parser.R [0.2 s]
x |   0 1     | test-reconciliation
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
test-reconciliation.R:4: error: reconciliation
`vars` must be a character vector
Backtrace:
  9. fabletools::aggregate_key(., key, value = sum(value))
  2. tsibble::build_tsibble_meta(...)
 10. dplyr::mutate(...)
 21. tsibble:::retain_tsibble(mut_data, key(.data), index(.data))
 22. tsibble:::duplicated_key_index(data, key, index)
 23. dplyr::grouped_df(as_tibble(data), key)
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✓ |   1       | test-spelling.R [1.5 s]
✓ |  34       | test-transformations [0.1 s]
✓ |  10       | test-validate_model.R

══ Results ══════════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 8.8 s

OK:       248
Failed:   6
Warnings: 2
Skipped:  2
Warning messages:
1: replacing previous import 'fabletools::units_since' by 'tsibble::units_since' when loading 'fable' 
2: `progress_estimated()` is deprecated as of dplyr 1.0.0. 
3: `progress_estimated()` is deprecated as of dplyr 1.0.0. 

This pull request only adresses one problem, I have not looked at the other in detail at this point.

mitchelloharawild commented 4 years ago

Thanks.

jaredlander commented 4 years ago

I'm being bit by

Input must be a vector, not a `fcdist` object.

too. I'm rolling back all versions of everything, to handle it until the new version is pushed to CRAN.

mitchelloharawild commented 4 years ago

This particular issue has been fixed in the development version, but yes - best wait until next week when everything is on CRAN.