ARROW-421: [Python] Retain parent reference in PyBytesReader #279

Closed
wants to merge 3 commits into
from

Projects

None yet

2 participants

@wesm
Member
wesm commented Jan 11, 2017 edited

Pass Buffer to BufferReader so that zero-copy slices retain reference to PyBytesBuffer, which prevents the bytes object from being garbage collected prematurely. Also added some helper tools for inspecting Arrow Buffer objects in Python.

Close #278

wesm added some commits Jan 11, 2017
@wesm wesm Pass Buffer to BufferReader so that zero-copy slices retain reference…
… to PyBytesBuffer, which prevents the bytes object from being garbage collected prematurely

Change-Id: I6212ec4315b8c76b3ed731bb733ee86fe646ce28
ef20185
@wesm wesm Fix accidental typo
Change-Id: I0f271fe498b5e72e7bed2b61993163a2fcca1bc2
50c195a
return '1.0'
+ if version == ParquetVersion_V2:
+ return '2.0'
@wesm
wesm Jan 11, 2017 Member

This was an unrelated API change from PARQUET-828, but wanted to get the test suite passing

@wesm wesm Rename method
Change-Id: I2dcc9ec55413a176aa02ff2b32f7b7ce04728891
acf730e
@xhochy
xhochy approved these changes Jan 11, 2017 View changes

+1, LGTM

@asfgit asfgit pushed a commit that closed this pull request Jan 11, 2017
@wesm wesm ARROW-421: [Python] Retain parent reference in PyBytesReader
Pass Buffer to BufferReader so that zero-copy slices retain reference to PyBytesBuffer, which prevents the bytes object from being garbage collected prematurely. Also added some helper tools for inspecting Arrow Buffer objects in Python.

Close #278

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #279 from wesm/ARROW-421 and squashes the following commits:

acf730e [Wes McKinney] Rename method
50c195a [Wes McKinney] Fix accidental typo
ef20185 [Wes McKinney] Pass Buffer to BufferReader so that zero-copy slices retain reference to PyBytesBuffer, which prevents the bytes object from being garbage collected prematurely
7d3e2a3
@asfgit asfgit closed this in 7d3e2a3 Jan 11, 2017
@wesm wesm deleted the wesm:ARROW-421 branch Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment