-
Notifications
You must be signed in to change notification settings - Fork 596
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: Implement Arrow PyCapsule Interface #9140
Comments
Makes sense to me! Would we also want to implement |
There's some ongoing discussion about this apache/arrow#39689 but my own understanding is that if you're exporting a "table" or "stream of batches", then you'd only implement the |
We have a single extension type used when exporting complex-type data from the snowflake backend to pyarrow. It's really only for internal use at the moment. Unclear how it would interact with the effort here, but I don't think it should be a blocker as it's the only backend that has this issue and I'm pretty sure we can solve the problem that type is solving in some other way if we need to. |
Sounds good to me - I pushed up a quick PR to support this for |
Is your feature request related to a problem?
Currently Ibis integrates with Arrow via the
to_pyarrow
method. The downside of this is that library consumers have to:to_pyarrow
method, which tends to be named differently in different libraries. E.g. DuckDB calls it.arrow()
and Polars calls it.to_arrow()
.What is the motivation behind your request?
The Arrow PyCapsule Interface is a new standard for exchanging Arrow data in Python. Among other benefits, this defines a single method name (
__arrow_c_stream__
) that is public and standardizedThis means that other libraries don't have to build specific connectors to Polars, DuckDB, Ibis, pyarrow, etc, but rather can implement support for any input object with an
__arrow_c_stream__
method. For my particular use case, a geospatial visualization library I develop, Lonboard, is Arrow based and looks for this method.Describe the solution you'd like
Implement an
__arrow_c_stream__
method wherever there's currently ato_pyarrow
method. This could be as simple aswhere it uses the fact that the pyarrow
Table
class implements this as of v14 or so (not 100% sure which version it was added in)What version of ibis are you running?
I haven't run ibis yet but
__arrow_c_stream__
is not found in a code search of the repo.What backend(s) are you using, if any?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: