You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "fboudra (via GitHub)" <gi...@apache.org> on 2026/09/17 10:24:17 UTC
[PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
fboudra opened a new pull request, #51372:
URL: https://github.com/apache/arrow/pull/51372
### Rationale for this change
https://github.com/apache/arrow/issues/50398
https://github.com/apache/arrow/issues/50829
### What changes are included in this PR?
First in the series: it replaces macro and struct-field access in
python/pyarrow/src/arrow/python/ with the equivalent public C API calls,
which are also part of the stable API:
- PyBytes_AS_STRING / PyBytes_GET_SIZE become PyBytes_AsString / PyBytes_Size
- PyByteArray_AS_STRING / PyByteArray_GET_SIZE become PyByteArray_AsString / PyByteArray_Size
- Py_TYPE(obj)->tp_name is replaced with helper functions (PyObject_StdStringTypeName) and PyObject_GetAttrString
The calls are plain CPython API, so nothing changes for a normal full API build. No build flags are touched in this PR, which makes it reviewable as a straight behavior-preserving change: configure and test exactly as before.
Also included, found while going through the files: a shadowed variable in AppendUTF32, a missing extension path in the MonthDayNano conversion, and the MonthDayNano docstring.
Verification: local build plus the python/pyarrow test suite, both green.
### Are these changes tested?
Yes
### Are there any user-facing changes?
No
### Was AI used for this PR?
**PR code and description written by:**
- [x ] Human
- [ ] AI
**Reviewed before submission by:**
- [ x] Human
- [ ] AI
- [ ] Not reviewed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "xieofxie (via GitHub) via github" <gi...@arrow.apache.org>.
xieofxie commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6912462674
> > I see you removed the label
>
> I've removed the label because we are not using the PR workflow labels anymore due to some changes on our workflows. For more information on that, see the following PRs and associated issues:
>
> * [GH-55411: [CI][Dev] Remove PR workflow (awaiting xxx) and associated logic and labels #55412](https://github.com/apache/arrow/pull/55412)
> * [GH-55471: [Dev] Stop clearing non-existent PR workflow labels on merge script #55472](https://github.com/apache/arrow/pull/55472)
Thanks for the quick reply! So will @jorisvandenbossche continue to review this pr? This blocks windows arm64 package supports which blocks many python packages.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6082646767
Since this PR is targetting the simple changes like `PyList_SET_ITEM` replacements, it might be good to complete this aspect here (e.g. there are some remaining `PyTuple_GET_SIZE`, `PyList_GET_SIZE`, some remaining places where we access `->tp_name`, etc)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "fboudra (via GitHub) via github" <gi...@arrow.apache.org>.
fboudra commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6549616569
> BTW, it would help with reviewing if you left your own further code changes as separate commits, instead of combining it within the rebased commits from the other PR (now it is hard to see which review comments from #50409 you have addressed)
ack
> > Also included, found while going through the files: a shadowed variable in AppendUTF32, a missing extension path in the MonthDayNano conversion, and the MonthDayNano docstring.
>
> What is this exactly about?
All three are on lines the abi3 rewrite touches anyway. The shadowing rename is hygiene. MonthDayNano is required: PyStructSequence_NewType is the only structseq constructor abi3 allows, and heap types need the fully-qualified name, so the repr becomes pyarrow.lib.MonthDayNano(...). The docstring feeds the __init__ help text in heap-type form. Repr change is user-visible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "xieofxie (via GitHub) via github" <gi...@arrow.apache.org>.
xieofxie commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6730632809
Hello @jorisvandenbossche could you help to review this pr again? Thanks a lot.
The abi3 transition blocks arm64 https://github.com/apache/arrow/pull/48539 which blocks many python pacakges.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "fboudra (via GitHub)" <gi...@apache.org>.
fboudra commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6068388795
> @fboudra can you indicate more precisely what this PR contains compared to #50409. Are this all the source code changes from that PR (which already got some review rounds), just with the other changes removed (the benchmark removal)?
@jorisvandenbossche The comment https://github.com/apache/arrow/pull/50409#issuecomment-5712871976 explains why I splitted into multiple PRs in an attempt to make it easier to review. The last PR #51377 has all the patches in the serie (33 patches in total).
The full PR (#51377) contains all of the source changes from #50409, the benchmark removal included, plus 20 new commits on top.
The first 13 commits are the 13 non-merge commits from #50409, cherry-picked onto current main. The five Merge upstream/main commits from #50409 are gone because this branch is rebased instead.
The benchmark removal is kept (Remove python/pyarrow/src/arrow/python/benchmark.cc, Remove pyarrow.benchmark). It's a prerequisite for the limited-API build, so I didn't drop it.
The 20 extra commits are work that isn't in #50409 (the limited-API port is incomplete):
- finishing the limited-API port: the remaining macro fast paths, PyGILState_Check → Py_IsInitialized, the datetime C-API via the capsule, vendored pythoncapi_compat fixes, refcount and stable-ABI semantics fixes, and cp311 compat fixes for Py_REFCNT and PyObject_CallFunction('s#')
- enabling the abi3 build: Py_LIMITED_API=0x030B0000 on arrow_python, Cython --limited-api, .abi3.so module suffix
- packaging and CI: the limited-API symbol audit script, the cp311-abi3 wheel matrix, and the perf gate
So the reviewed changes from #50409 are all here unchanged. If it helps, I can keep #50409 open for the conversions and rebase this PR onto it, so the new work gets reviewed separately.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6068955042
Yes, I understand why you created multiple PRs (and that is a good idea), but I was specifically asking about _this_ PR.
This PR is just the code changes from https://github.com/apache/arrow/pull/50409 but rebased?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "fboudra (via GitHub) via github" <gi...@arrow.apache.org>.
fboudra commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6549647631
> Since this PR is targetting the simple changes like `PyList_SET_ITEM` replacements, it might be good to complete this aspect here (e.g. there are some remaining `PyTuple_GET_SIZE`, `PyList_GET_SIZE`, some remaining places where we access `->tp_name`, etc)
It's a deliberate staging: the Py_LIMITED_API define only lands in PR 4/6 , so earlier PRs stay full-API-buildable. Remaining at end of PR 1/6, with the PR that finishes each: [inventory table]. Nothing at branch tip outside the two compat headers. I moved the refcount fix from PR 4/6 into PR 3/6 so it's independent.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "raulcd (via GitHub) via github" <gi...@arrow.apache.org>.
raulcd commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6912368301
> I see you removed the label
I've removed the label because we are not using the PR workflow labels anymore due to some changes on our workflows. For more information on that, see the following PRs and associated issues:
- https://github.com/apache/arrow/pull/55412
- https://github.com/apache/arrow/pull/55472
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6082276676
BTW, it would help with reviewing if you left your own further code changes as separate commits, instead of combining it within the rebased commits from the other PR (now it is hard to see which review comments from https://github.com/apache/arrow/pull/50409/ you have addressed)
> Also included, found while going through the files: a shadowed variable in AppendUTF32, a missing extension path in the MonthDayNano conversion, and the MonthDayNano docstring.
What is this exactly about?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "fboudra (via GitHub)" <gi...@apache.org>.
fboudra commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6069018028
This one (1/6), yes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6063871815
@fboudra can you indicate more precisely what this PR contains compared to https://github.com/apache/arrow/pull/50409. Are this all the source code changes from that PR (which already got some review rounds), just with the other changes removed (the benchmark removal)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50398/GH-50829 1/6: Use more CPython Limited APIs in python/pyarrow [arrow]
Posted by "xieofxie (via GitHub) via github" <gi...@arrow.apache.org>.
xieofxie commented on PR #51372:
URL: https://github.com/apache/arrow/pull/51372#issuecomment-6912266332
Hi @raulcd will you review this? I see you removed the label. Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org