Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(python, rust!): Read/write support for IPC streams in DataFrames #10606

Merged
merged 1 commit into from
Aug 20, 2023

Conversation

sdamashek
Copy link
Contributor

@sdamashek sdamashek commented Aug 19, 2023

Adds support for reading and writing Arrow IPC streams (see "Streaming format" in https://arrow.apache.org/docs/python/ipc.html) to py-polars DataFrames. py-polars had support for IPC files (formerly "Feather" files), but did not have support for IPC streams (which are essentially just streams of RecordBatches). IPC streams are useful for reading from and writing to network streams of RecordBatches, without random access / seek support.

This feature does not add IPC stream support to LazyFrames. I don't think it makes much sense to copy the existing scan_ipc and sink_ipc for streams, because these only support files on disk, but I think IPC streams make the most sense in streaming contexts (such as network I/O). I've created for an issue for this; see #10605.

Includes a potentially breaking Rust change as well, changing the with_compression argument type to IpcStreamWriter to match that of IpcWriter (polars_io::ipc::IpcCompression, instead of a type from arrow2).

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Aug 19, 2023
@sdamashek sdamashek marked this pull request as draft August 19, 2023 07:21
@sdamashek sdamashek changed the title feat(python): Read/write support for IPC streams in DataFrames feat(python, rust)!: Read/write support for IPC streams in DataFrames Aug 19, 2023
@github-actions github-actions bot added breaking Change that breaks backwards compatibility rust Related to Rust Polars labels Aug 19, 2023
@sdamashek sdamashek marked this pull request as ready for review August 19, 2023 08:03
@ritchie46 ritchie46 changed the title feat(python, rust)!: Read/write support for IPC streams in DataFrames feat(python, rust!): Read/write support for IPC streams in DataFrames Aug 20, 2023
@github-actions github-actions bot added the breaking rust Change that breaks backwards compatibility for the Rust crate label Aug 20, 2023
@ritchie46
Copy link
Member

Yeap, PR looks great. Thank you.

@ritchie46 ritchie46 merged commit a75495a into pola-rs:main Aug 20, 2023
26 checks passed
eitsupi added a commit to pola-rs/r-polars that referenced this pull request Apr 13, 2024
@kdkavanagh
Copy link

Hey @sdamashek, curious if you attempted to implement scan_ipc_stream but hit a roadblock or something? I have a usecase for it / want to see if I can largely just copy/paste your work here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking rust Change that breaks backwards compatibility for the Rust crate breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants