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

Unclear Memory Ownership and Lifetimes #351

Open
WillAyd opened this issue Feb 22, 2024 · 0 comments
Open

Unclear Memory Ownership and Lifetimes #351

WillAyd opened this issue Feb 22, 2024 · 0 comments

Comments

@WillAyd
Copy link

WillAyd commented Feb 22, 2024

I see the scope of the dataframe api mentions "Memory Ownership and Lifetimes" as In Scope, but I couldn't find anything in else in the document that actually enforces this.

While trying to use the dataframe api with pandas, I ran into an issue where the current pandas implementation to write string data makes a temporary buffer whose lifetime has nothing to do with the dataframe itself. I found this because I wrote an extension that assumed the lifetime of a buffer in the dataframe API was the same as the producing dataframe. That held while I was using primitive types but once I tried to use strings I started seeing segfaults.

My first thought was that pandas was doing something wrong, but without any guidance from the document it is hard to make that judgment.

By contrast, the Arrow C Data specification (which I ultimately ended up using) has well defined semantics for memory management:

https://arrow.apache.org/docs/format/CDataInterface.html#memory-management

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant