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

ARROW-2270: [Python] Fix lifetime of ForeignBuffer base object #1714

Closed
wants to merge 1 commit into from

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented Mar 6, 2018

No description provided.

@pitrou pitrou force-pushed the ARROW-2270-pyforeignbuffer branch from 93f85f9 to 37a9f78 Compare March 6, 2018 11:59
// ----------------------------------------------------------------------
// Foreign buffer

Status PyForeignBuffer::Make(const uint8_t* data, int64_t size, PyObject* base,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the description of the JIRA ticket somewhere in the code? I was not aware what went wrong in the initial implementation only from reading the change but I needed the context of the JIRA issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I added an explanation.

@pitrou pitrou force-pushed the ARROW-2270-pyforeignbuffer branch from 37a9f78 to 217aa3a Compare March 6, 2018 19:50
@pitrou
Copy link
Member Author

pitrou commented Mar 6, 2018

(note that a separate Python-facing ForeignBuffer isn't really necessary anymore)

Copy link
Member

@xhochy xhochy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thanks for spotting this memory "loophole".

@wesm
Copy link
Member

wesm commented Mar 6, 2018

Do we need to remove pyarrow.ForeignBuffer, then?

@pitrou
Copy link
Member Author

pitrou commented Mar 6, 2018

The alternative would be to expose a factory function, e.g. pa.foreign_buffer(addr, size, base).

@xhochy
Copy link
Member

xhochy commented Mar 6, 2018

Happy with the function. It could be nice to also access the base object later on again but currently I see no need for that.

@pitrou pitrou force-pushed the ARROW-2270-pyforeignbuffer branch from 217aa3a to 9e9c8c8 Compare March 6, 2018 20:55
@pitrou
Copy link
Member Author

pitrou commented Mar 6, 2018

Ok, I did the change to the factory function.

Copy link
Member

@xhochy xhochy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thanks @pitrou!

@wesm wesm force-pushed the ARROW-2270-pyforeignbuffer branch from 9e9c8c8 to 51f2d85 Compare March 9, 2018 04:31
@wesm
Copy link
Member

wesm commented Mar 9, 2018

I added this new function to the API documentation. Merging

@wesm wesm closed this in f56fdc9 Mar 9, 2018
@pitrou pitrou deleted the ARROW-2270-pyforeignbuffer branch March 9, 2018 09:39
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

Successfully merging this pull request may close these issues.

None yet

3 participants