Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-13661

[R] Objects Written to Feather Not Restored Exactly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0.0
    • None
    • R
    • R4.1.1, Ubuntu 20.04

    Description

      Rather simple - write the standard 'iris' dataset to feather, then read it back.

      At first glance everything looks the same, but setting 'attrib.as.set = FALSE' to identical() will return FALSE.

      Using Waldo to compare, you can see that the order of attributes is different on the restored object. "class" should be the second attribute after "names" but before "row.names".

      This should be a simple fix to the 'read_feather' function to set the correct order of attributes.

      iris <- iris
      arrow::write_feather(iris, file <- tempfile())
      iris2 <- arrow::read_feather(file)
      unlink(file)
      identical(iris, iris2)
      #> [1] TRUE
      identical(iris, iris2, attrib.as.set = FALSE)
      #> [1] FALSE
      waldo::compare(attributes(iris), attributes(iris2))
      #> `names(old)`: "names" "class" "row.names"
      #> `names(new)`: "names" "row.names" "class"

      Attachments

        Activity

          People

            Unassigned Unassigned
            shikokuchuo Charlie Gao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: