You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[R] arrow_table: as.data.frame() sometimes returns a tbl and sometimes a data.frame #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:
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.
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.
Activity
thisisnic commentedon Mar 30, 2023
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.
GH-34775: [R] arrow_table: as.data.frame() sometimes returns a tbl an…
apacheGH-34775: [R] arrow_table: as.data.frame() sometimes returns a …
apacheGH-34775: [R] arrow_table: as.data.frame() sometimes returns a …