Skip to content

ENH: Support out-of-band pickling (protocol 5) #34244

Closed
@jakirkham

Description

@jakirkham

Is your feature request related to a problem?

It would be nice if Pandas objects supported pickle's protocol 5 for out-of-band serialization. This would allow the underlying data to be captured in PickleBuffers (specialized memoryview). For libraries using pickle's protocol 5 to transmit data over the wire, this would allow for zero-copy data transmission.

Describe the solution you'd like

Pandas objects implement __reduce_ex__ and if the protocol argument is 5 or greater, they construct PickleBuffers out of any data arguments.

API breaking implications

NA as it should be possible to fallback to existing behavior for older pickle protocols. Users have to actively opt-in at a higher level API (through pickle) to see any effect.

Describe alternatives you've considered

NA

Additional context

This would be useful in libraries that support distributed dataframes ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions