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

Compatibility with dplyr 1.1.0 #3

Merged
merged 3 commits into from
Jan 31, 2023

Conversation

DavisVaughan
Copy link
Contributor

dplyr 1.1.0 is on its way to CRAN right now.

The checks run by CRAN noticed that eHDPrep is broken by this dplyr release, and it somehow slipped through our own reverse dependency checks.

  • na_if() now casts y to the type of x and requires that y be a compatible type. A character "NA" is not a compatible type with a list-column. It seems like you should be using list("NA") here instead, so I've changed to that.
  • We have also deprecated usage of ... in across() and instead encourage using anonymous functions. Those were only throwing warnings but I went ahead and updated those too

dplyr 1.0.10 results in:

  > identify_inconsistency(beans, bean_rules)
  Error in `dplyr::mutate()`:
  ! Problem while computing `lgl_values = dplyr::na_if(.data$lgl_values,
    list("NA"))`.
  Caused by error in `x == y`:
  ! comparison of these types is not implemented
  Backtrace:
       ▆
    1. ├─eHDPrep::identify_inconsistency(beans, bean_rules)
    2. │ └─... %>% ...
    3. ├─dplyr::mutate(...)
    4. ├─dplyr:::mutate.data.frame(., lgl_values = dplyr::na_if(.data$lgl_values, list("NA")))
    5. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), caller_env = caller_env())
    6. │   ├─base::withCallingHandlers(...)
    7. │   └─mask$eval_all_mutate(quo)
    8. ├─dplyr::na_if(.data$lgl_values, list("NA"))
    9. └─base::.handleSimpleError(...)
   10.   └─dplyr (local) h(simpleError(msg, call))
   11.     └─rlang::abort(...)
  Execution halted
@tommtoner
Copy link
Collaborator

Thanks, Davis, for finding and addressing this issue. I believe that the type change in na_if() produces the error below when running the examples for identify_inconsistency() if using dplyr 1.0.10 (see this check). I have increased the minimum dplyr version required by eHDPrep to 1.1.0 to fix this.

  Error in `dplyr::mutate()`:
  ! Problem while computing `lgl_values = dplyr::na_if(.data$lgl_values,
    list("NA"))`.
  Caused by error in `x == y`:
  ! comparison of these types is not implemented
  Backtrace:
       ▆
    1. ├─eHDPrep::identify_inconsistency(beans, bean_rules)
    2. │ └─... %>% ...
    3. ├─dplyr::mutate(...)
    4. ├─dplyr:::mutate.data.frame(., lgl_values = dplyr::na_if(.data$lgl_values, list("NA")))
    5. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), caller_env = caller_env())
    6. │   ├─base::withCallingHandlers(...)
    7. │   └─mask$eval_all_mutate(quo)
    8. ├─dplyr::na_if(.data$lgl_values, list("NA"))
    9. └─base::.handleSimpleError(...)
   10.   └─dplyr (local) h(simpleError(msg, call))
   11.     └─rlang::abort(...)
  Execution halted```

@tommtoner tommtoner merged commit e760293 into overton-group:main Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants