tidyverse / funs

Collection of low-level functions for working with vctrs
Other
34 stars 7 forks source link

vec_equal_na is deprecated #82

Open elinw opened 1 year ago

elinw commented 1 year ago

In trying to prepare to release our skimr update related to purrr's update we have come across an issue where a call to vec_equal_na() is resulting in an error.
https://github.com/ropensci/skimr/issues/719 Copied from that issue

withr::with_options(list(lifecycle_verbosity = "error"),
                    skimr::skim(iris))
Error in `dplyr::summarize()`:
! Problem while computing `skimmed =
  purrr::map2(...)`.
ℹ The error occurred in group 2: skim_type = "numeric".
Caused by error:
! `vec_equal_na()` was deprecated in vctrs 0.5.0.
ℹ Please use `vec_detect_missing()` instead.
Run `rlang::last_error()` to see where the error occurred.

{funs} is the only place seem to be able to trace this to. It still has pre-1.0 minimum for purrr which explains why I couldn't reproduce it until I updated purrr.

Would it make sense to follow the advice to switch to vec_detect_missing()?

Adding backtrace

rlang::last_error() <error/rlang_error> Error in dplyr::summarize() at skimr/R/skim_with.R:121:4: ! Problem while computing skimmed = purrr::map2(...). ℹ The error occurred in group 2: skim_type = "numeric". Caused by error in purrr::map2(): ℹ In index: 1.

Backtrace:

  1. withr::with_options(list(lifecycle_verbosity = "error"), skimr::skim(iris))
    1. purrr (local) <fn>(<lfcycl__>)
    2. cli::cli_abort(c(i = "In index: {i}."), parent = cnd, call = error_call) Caused by error: ! vec_equal_na() was deprecated in vctrs 0.5.0. ℹ Please use vec_detect_missing() instead.

      Backtrace:

  2. withr::with_options(list(lifecycle_verbosity = "error"), skimr::skim(iris))
    1. purrr::map2(.data$skimmers, .data$skim_variable, skim_by_type, data)
    2. purrr:::map2_("list", .x, .y, .f, ..., .progress = .progress)
    3. skimr:::skim_by_type.data.frame(.x[[i]], .y[[i]], ...) at skimr/R/skim_with.R:335:2
    4. skimr:::build_results(skimmed, variable_names, NULL) at skimr/R/skim_with.R:355:2
    5. tidyr:::unnest.data.frame(out, "by_variable")
    6. tidyr::unchop(data, any_of(cols), keep_empty = keep_empty, ptype = ptype)
    7. tidyr:::df_unchop(cols, ptype = ptype, keep_empty = keep_empty)
    8. tidyr:::list_init_empty(x = col, null = TRUE, typed = keep_empty)
    9. vctrs::vec_equal_na(x)
    10. lifecycle::deprecate_soft("0.5.0", "vec_equal_na()", "vec_detect_missing()")
    11. lifecycle:::deprecate_stop0(msg) Run rlang::last_trace() to see the full context.