Skip to content

[Python] Pandas is deprecating dataframe interchange protocol #49600

@AlenkaF

Description

@AlenkaF

Describe the enhancement requested

New warnings are appearing with pytest and doctest:

  /opt/conda/envs/arrow/lib/python3.11/site-packages/pyarrow/interchange/from_dataframe.py:113: Pandas4Warning: The Dataframe Interchange Protocol is deprecated.
  For dataframe-agnostic code, you may want to look into:
  - Arrow PyCapsule Interface: https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
  - Narwhals: https://github.com/narwhals-dev/narwhals
  
    return _from_dataframe(df.__dataframe__(allow_copy=allow_copy),

due to Pandas moving the dataframe interchange protocol out of the repo in the next major release (4.0.0), see:

Two things that come to mind:

  • for the time being, which library to use in the conversion tests and documentation examples? Maybe Polars? @jorisvandenbossche I am not sure if there is a plan to have a separate pandas interchange package or that was just an initial idea and pandas plans to completely move away from the protocol?
  • How long to keep the implementation of the protocol in PyArrow. I think we should maintain it for a while. There has been not much of maintainance burden so far. The only problem is that feature requests are stuck due to the dataframe interchange protocol project being idle.

Component(s)

Python

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions