ankane / ruby-polars

Blazingly fast DataFrames for Ruby
Other
860 stars 34 forks source link

Request: Add support for `df.write_ipc` and `df.write_parquet` (with no args, and with StringIO/BytesIO args) #80

Closed DeflateAwning closed 1 month ago

DeflateAwning commented 1 month ago

Modern Python polars supports calling write_ipc with no args (i.e., file = nil); the bytes are then returned directly. Would be awesome to support that here.

Same thing for df.write_parquet, except writing to a StringIO/BytesIO

ankane commented 1 month ago

Hi @DeflateAwning, this is already possible.

io = StringIO.new

df.write_ipc(io)
# or
df.write_parquet(io)
# or
df.write_ipc(nil)
DeflateAwning commented 1 month ago

Thank you! I was on v0.13.0, and I don't think it was working on that one. Seems good now though (on v0.14.0).