Skip to content

[R]: vctrs custom class errors on roundtrip #42220

@jonkeane

Description

@jonkeane

Describe the bug, including details regarding any error messages, version, and platform.

I think that this is fallout from #41969 but when making some examples for how to make a custom vctrs class I ran into an error on round trip Error in '[<-': ! Can't convert 'value' <list> to <special>..

library(arrow, quietly = TRUE, warn.conflicts = FALSE)
#> Warning: package 'arrow' was built under R version 4.4.1
library(vctrs, quietly = TRUE, warn.conflicts = FALSE)

special <- function(n = integer()) {
  new_rcrd(
    fields = list(special = n),
    class = "special"
  )
}

frac_df <- data.frame(
  total = c(2, 2, 7, 9)
)

frac_df$special = special(frac_df$total)

as_arrow_table(frac_df)
#> Error in `[<-`:
#> ! Can't convert `value` <list> to <special>.

Created on 2024-06-20 with reprex v2.1.0

Component(s)

R

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions