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] auto splice data frames in record_batch() and table() #22146
In order to follow best practices (cf. the tibble package, for example), we should (1) add an as_record_batch function, which the data.frame method is probably just as_record_batch.data.frame <- function(x) record_batch(!!!x); and (2) if a user supplies a single, unnamed data.frame as the argument to record_batch(), raise an error that says to use as_record_batch(). We may later decide that we should automatically call as_record_batch(), but in case that is too magical and prevents some legitimate use case, let's hold off for now. It's easier to add magic than remove it.
Once this function exists, sparklyr tests can try to use as_record_batch, and if that function doesn't exist, fall back to record_batch (because that means it has an older released version of arrow that doesn't have as_record_batch, so record_batch(df) should work).
Activity
asfimport commentedon Jun 24, 2019
Wes McKinney / @wesm:
Is there a link to the related discussion or some other cross-reference?
asfimport commentedon Jun 25, 2019
Romain Francois / @romainfrancois:
I think it's fine if we were to auto splice, i.e.:
record_batch(mtcars)would be the same as
because unnamed, this is the direction we'll take in. dplyr too for e.g. summarise and mutate.
However, something like :
will create a struct array, aka a data frame column.
asfimport commentedon Jun 25, 2019
Neal Richardson / @nealrichardson:
Makes sense to me.