feat: Implement Arrow PyCapsule Interface for data import, schema
Is your feature request related to a problem?
This is a follow up to a previous feature request (https://github.com/ibis-project/ibis/issues/9140). That added export via the PyCapsule interface but I think there's also further gains from being able to import via the PyCapsule interface as well.
Additionally, the ibis schema is presumably Arrow or arrow-compatible under the hood? It would be great to implement the PyCapsule Interface on the schema object as well.
What is the motivation behind your request?
Easier interoperability between Ibis and other Python Arrow-based libraries.
Describe the solution you'd like
I'm not sure how ibis works under the hood and whether there's an easy API for Arrow import that's already in Python? I see there's a read_parquet method but is that pushed down to relevant implementations?
What version of ibis are you running?
Latest
What backend(s) are you using, if any?
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Additionally, the ibis schema is presumably Arrow or arrow-compatible under the hood? It would be great to implement the PyCapsule Interface on the schema object as well.
This is definitely doable, can push up a PR momentarily.
I think there's also further gains from being able to import via the PyCapsule interface as well.
I'm not sure what you're exactly asking for here. Are you asking for a way to create an ibis.Table from something exposing an __arrow_c_stream__ interface (fairly easy)? Or from the capsule object itself? Or something else?
I'm not sure what you're exactly asking for here. Are you asking for a way to create an
ibis.Tablefrom something exposing an__arrow_c_stream__interface (fairly easy)?
Yes, that's all!
Got it, thanks! I'll push up a PR adding both ASAP.