rlang icon indicating copy to clipboard operation
rlang copied to clipboard

Error in `date_validate()`: [dplyr library - This is an internal error in the rlang package, please report it to the package authors.]

Open sasthavignesh opened this issue 1 year ago • 2 comments

I came across this error when using dplyr library "distinct(across(everything()))", but the error message pointed to rlang. Please find a reprex below.

Distinct function was working on the existing code for a while, for last couple of days getting the same error

listHC$FACTS <- listHC$FACTS %>% distinct(across(everything())) Error in date_validate(): ! Corrupt Date with unknown type character. i In file type-date-time.c at line 345. i This is an internal error in the rlang package, please report it to the package authors. Backtrace: x

  1. -listHC$FACTS %>% distinct(across(everything()))
  2. -/magrittr.dll::000000006130185f()
  3. +-dplyr::distinct(., across(everything()))
    
  4. +-dplyr:::distinct.data.frame(., across(everything()))
    
  5. | \-dplyr::distinct_prepare(...)
    
  6. |   \-dplyr:::add_computed_columns(...)
    
  7. |     +-dplyr::dplyr_col_modify(.data, cols)
    
  8. |     \-dplyr:::dplyr_col_modify.data.frame(.data, cols)
    
  9. |       \-vctrs::vec_recycle_common(!!!cols, .size = nrow(data))
    
  10. |         \-`/vctrs.dll`::`000000006816fbef`()
    
  11. |           \-`/vctrs.dll`::`000000006816f89f`()
    
  12. |             \-`/vctrs.dll`::`000000006817026f`()
    
  13. |               \-`/vctrs.dll`::`000000006816fdbf`()
    
  14. |                 \-`/vctrs.dll`::`000000006817ee0f`()
    
  15. |                   \-`/vctrs.dll`::`00000000681855ff`()
    
  16. |                     \-`/vctrs.dll`::`00000000681855af`()
    
  17. |                       \-`/vctrs.dll`::`0000000068184f6f`()
    
  18. |                         \-vctrs `<fn>`()
    
  19. |                           \-vctrs::vec_proxy(x = x)
    
  20. |                             \-vctrs:::date_validate(x)
    
  21. |                               \-`/vctrs.dll`::`000000006817d8af`()
    
  22. |                                 \-`/rlang.dll`::`00000000007a2ddf`()
    
  23. |                                   \-`/rlang.dll`::`00000000007a2cff`()
    
  24. |                                     \-`/rlang.dll`::`00000000007ba7af`()
    
  25. \-rlang:::stop_internal_c_lib(...)
    
  26.   \-rlang::abort(message, call = call, .internal = TRUE)
    

sasthavignesh avatar Aug 01 '22 23:08 sasthavignesh

I'm seeing

! Corrupt Date with unknown type character.

It is likely that you have some kind of corrupt column in your data frame.

Can you please post a full reprex? http://tidyverse.org/help/

DavisVaughan avatar Aug 16 '22 13:08 DavisVaughan

I can only reproduce this with significant effort, so I think it is an error with your data generating process somehow, and not an error with rlang, vctrs, or dplyr.

df <- data.frame(x = .Date("a"))
dplyr::distinct(df, x)
#> Error in `date_validate()`:
#> ! Corrupt `Date` with unknown type character.
#> ℹ In file 'type-date-time.c' at line 345.
#> ℹ This is an internal error in the vctrs package, please report it to the package authors.

Created on 2022-08-16 by the reprex package (v2.0.1)

DavisVaughan avatar Aug 16 '22 13:08 DavisVaughan