Skip to content

Conversation

@chaokunyang
Copy link
Collaborator

@chaokunyang chaokunyang commented Jan 27, 2026

Why?

  • Python Cython buffer implementation duplicated C++ buffer logic and error handling.
  • Centralizing buffer reads/writes in the C++ buffer reduces duplication and keeps behavior aligned.

What does this PR do?

  • Refactors python/pyfory/buffer.pyx to delegate reads/writes, varint/tagged encoding, and bounds checks to fory::Buffer.
  • Adds C++ Buffer int24 helpers and exposes missing buffer APIs/errors to Cython via libutil.pxd.
  • Introduces Python error mapping helpers and updates row/collection code to pass C++ buffer pointers correctly.

Related issues

Closes #3218

#3216
#1017
#3220

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

@chaokunyang chaokunyang self-assigned this Jan 27, 2026
@chaokunyang chaokunyang force-pushed the refactor_python_buffer branch from 5441b50 to 7d7cf71 Compare January 27, 2026 05:28
@chaokunyang chaokunyang merged commit 9b8c1ea into apache:main Jan 27, 2026
62 checks passed
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.

[Python] refactor cython Buffer to wrap encoding to c++ Buffer

2 participants