Closed eitsupi closed 3 months ago
Thanks, I agree it should probably be changed for consistency with other R packages. I'm just thinking of how I'm gonna make this apparent in the docs. I made a small demo of polars + tidypolars at work and it was very convenient to use the term "collect" independently of whether I was talking about py-polars, r-polars or tidypolars. Using "collect" for py-polars and r-polars but "compute" for tidypolars will introduce some confusion I think
Using "collect" for py-polars and r-polars but "compute" for tidypolars will introduce some confusion I think
I don't know why you just issue "collect", I think things like "select", "where" and "group_by" also work differently in polars and dplyr.
This will be implemented in 0.8.0. For now I implemented a warning redirecting to compute()
. Small summary of behavior by version:
collect
-> Polars DataFrame, no compute
collect
-> Polars DataFrame but warns that behavior will change, compute
-> Polars DataFramecollect
-> data.frame, compute
-> Polars DataFrame
Please check the behavior of the other dplyr backends.
dplyr::collect()
is intended to return data.frame (tibble)dplyr::compute()
is intended to return backends' formathttps://dplyr.tidyverse.org/reference/compute.html
So here
collect()
should return data.frame andcompute()
should return RPolarsDataFrame.You can also set the number of rows to return with an optional argument like dbplyr's collect's
n
, so there is no need to maintain your own functionfetch()
. https://dbplyr.tidyverse.org/reference/collapse.tbl_sql.htmlAlso check polarssql behavior. https://rpolars.github.io/r-polarssql/reference/compute.tbl_polarssql_connection.html