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

vec_ptype2.character.character issue #1854

Open
BurninLeo opened this issue Jun 29, 2023 · 0 comments
Open

vec_ptype2.character.character issue #1854

BurninLeo opened this issue Jun 29, 2023 · 0 comments

Comments

@BurninLeo
Copy link

The vctrs package asked me to report an error:

Please report it at https://github.com/r-lib/vctrs/issues with a reprex and the full backtrace.

Here we go:

Error in `stop_native_implementation()`:
! `vec_ptype2.character.character()` is implemented at C level.
  This R function is purely indicative and should never be called.
ℹ This is an internal error that was detected in the vctrs package.
  Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex and the full backtrace.
Backtrace:
 1. ... %>% bind_rows(mz %>% cleanup1() %>% cleanup2())
 2. dplyr::bind_rows(., mz %>% cleanup1() %>% cleanup2())
 3. vctrs::vec_rbind(!!!dots, .names_to = .id, .error_call = current_env())
 4. vctrs (local) `<fn>`()
 5. vctrs:::vec_ptype2.character.character(...)
 6. vctrs:::stop_native_implementation("vec_ptype2.character.character")
Error in stop_native_implementation("vec_ptype2.character.character") :

This R function is purely indicative and should never be called.
ℹ This is an internal error that was detected in the vctrs package.
Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex and the full backtrace.
10.
stop(fallback)
9.
signal_abort(cnd, .file)
8.
rlang::abort(message, ..., call = call, use_cli_format = TRUE,
.frame = .frame)
7.
cli::cli_abort(c("{.fn {fn}} is implemented at C level.", ` ` = "This R function is purely indicative and should never be called."),
.internal = TRUE)
6.
stop_native_implementation("vec_ptype2.character.character")
5.
vec_ptype2.character.character(x = x, y = y, x_arg = x_arg, y_arg = y_arg,
call = call, `vctrs:::s3_fallback` = `vctrs:::s3_fallback`)
4.
(function ()
vec_ptype2.character.character(x = x, y = y, x_arg = x_arg, y_arg = y_arg,
call = call, `vctrs:::s3_fallback` = `vctrs:::s3_fallback`))()
3.
vec_rbind(!!!dots, .names_to = .id, .error_call = current_env())
2.
bind_rows(., mz %>% cleanup1() %>% cleanup2())
1.
merge(m1 %>% cleanup1(), m2 %>% cleanup1(), by.x = "R103", by.y = "SERIAL",
all.x = T, all.y = T) %>% cleanup2() %>% bind_rows(mz %>%
cleanup1() %>% cleanup2())

And here's a replication code I built

add_class = function(x) {
    x = data.frame(
      lapply(x, function(xx) {
        structure(xx, class = c("avector", class(xx)))
      })
    )
    return(x)
}
drop_class = function(x) {
    x = data.frame(
      lapply(x, function(xx) {
        structure(xx, class = setdiff(class(xx), c("avector")))
      })
    )
    return(x)
}

x1 = rbind(c(1,2,"c"), c(2,3,"d"))
x2 = rbind(c(3,4,"d"), c(4,5,"f"))

bind_rows(
    x1 %>% add_class() %>% drop_class(),
    x2 %>% add_class() %>% drop_class()
)

No need to discuss the add_class () / drop_class() functions, this issue is only upon request to report problematic error reporting :)

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

No branches or pull requests

1 participant