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

fix(python): Fix use of memoryview to write fill to the buffer builder #477

Merged
merged 6 commits into from
May 19, 2024

Conversation

paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented May 18, 2024

At least one test is failing on pypy because of an unreleased buffer. This was due to the line:

memoryview(builder)[out_start : out_start + length] = b"\x01" * length

...which relied on the deletion of memoryview(builder) to release the builder buffer. One solution is:

with memoryview(builder) as mv:
  mv[out_start : out_start + length] = b"\x01" * length

However, we also have ArrowBufferAppendFill() in the C library, so instead, this PR wires that up and uses it (which should be faster, anyway).

@paleolimbot paleolimbot changed the title fix(python): Bypass locking of buffer on write when we control all write calls fix(python): Fix use of memoryview to write fill to the buffer builder May 18, 2024
@paleolimbot paleolimbot marked this pull request as ready for review May 18, 2024 17:19
@paleolimbot paleolimbot merged commit 134c66d into apache:main May 19, 2024
6 checks passed
@paleolimbot paleolimbot deleted the python-pypy-buffer-locked branch May 19, 2024 12:27
@paleolimbot paleolimbot added this to the nanoarrow 0.5.0 milestone May 22, 2024
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.

1 participant