You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "daattali (via GitHub)" <gi...@apache.org> on 2023/03/29 17:04:03 UTC

[GitHub] [arrow] daattali opened a new issue, #34775: [R] arrow_table: as.data.frame() sometimes returns a tbl and sometimes a data.frame

daattali opened a new issue, #34775:
URL: https://github.com/apache/arrow/issues/34775

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   The documentation for `arrow_table()` says that you can call `as.data.frame()` on an arrow table object to convert it to a dataframe. It seems like the behaviour is inconsistent. Example:
   
   ```r
   > class(as.data.frame(arrow::arrow_table(name = "1", mtcars)))
   [1] "tbl_df"     "tbl"        "data.frame"
   > class(as.data.frame(arrow::arrow_table(mtcars, name = "1")))
   [1] "data.frame"
   ```
   
   I created the same arrow_table in both cases but only changed the order of the arguments, and it returned a different object type.
   
   I would expect it to be base R dataframe since `as.data.frame()` is a generic from base R that is generally assumed to convert to actual `data.frame` objects, not to tibbles. Right now if I want to guarantee a base R data.frame, I need to do `as.data.frame(as.data.frame(table))`. I need to ocnvert it using the same function twice, which is extremely awkward and unintuitive. I strongly believe arrow should not conflate `data.frame()` with `tbl_df`, it can cause errors for users.
   
   ### Component(s)
   
   R


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on issue #34775: [R] arrow_table: as.data.frame() sometimes returns a tbl and sometimes a data.frame

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on issue #34775:
URL: https://github.com/apache/arrow/issues/34775#issuecomment-1489786844

   Thanks for reporting this, I agree it's not intended behaviour.  Looks like it's something to do with how metadata is handled, will have a closer look at this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic closed issue #34775: [R] arrow_table: as.data.frame() sometimes returns a tbl and sometimes a data.frame

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic closed issue #34775: [R] arrow_table: as.data.frame() sometimes returns a tbl and sometimes a data.frame
URL: https://github.com/apache/arrow/issues/34775


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org