Skip to content

[R] Factor type not preserved in Parquet roundtrip #23355

@asfimport

Description

@asfimport
test_that("Factors are preserved when writing/reading from Parquet", {
  tf <- tempfile()
  on.exit(unlink(tf))
  df <- data.frame(a = factor(c("a", "b")))
  write_parquet(df, tf)
  expect_equivalent(read_parquet(tf), df)
})

Fails:

`object` not equivalent to `expected`.
Componenta”: target is character, current is factor

This has to do with the translation with Parquet and not the R <--> Arrow type mapping (unlike ARROW-7028). If you write_feather and read_feather, the test passes.

Reporter: Neal Richardson / @nealrichardson
Assignee: Hiroaki Yutani / @yutannihilation

PRs and other links:

Note: This issue was originally created as ARROW-7045. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions