pola-rs / r-polars

Bring polars to R
https://pola-rs.github.io/r-polars/
Other
398 stars 35 forks source link

feat: serialize/deserialize LazyFrame #1073

Closed eitsupi closed 1 week ago

eitsupi commented 2 weeks ago

The Python class method polars.LazyFrame.deserialize() cannot be expressed well here, so I assigned a function pl$deserialize_lf(). The function name could be change.

In addition, in Python, these functions can also have files as input/output destinations, but here I am simplifying to interacting with character vectors. Reading and writing to files must be done by other functions.

eitsupi commented 2 weeks ago

It might be worthwhile to enable the format to be specified as chracter or raw, as in nodejs. https://pola-rs.github.io/nodejs-polars/interfaces/pl.LazyDataFrame.html#serialize

eitsupi commented 1 week ago

Should we add a comment about security concerns when deserializing an unknown input as they do in the py-polars docs?

I think there is a special feature for Python that saves Python objects as pickle for Python. I don't think the concern exists because there is no R-only functionality here and Polars does not restore anything like rds files.