Repository navigation
GH-47823: [Python] Use PyWeakref_GetRef instead of PyWeakref_GET_OBJECT (Python 3.15) - #48027
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
|
|
@github-actions crossbow submit -g python -g wheel |
|
Revision: 563a421 Submitted crossbow builds: ursacomputing/crossbow @ actions-4a1a654c08 |
AlenkaF
left a comment
There was a problem hiding this comment.
LGTM, the change from PyWeakref_GET_OBJECT to PyWeakref_GetRef is clear. Thanks for the contribution!
|
Thanks for merging @AlenkaF I totally forgot this wasn't merged yet and thought we did merge it. |
|
Me too! Thankfully had it in one of the many tabs still open 😊 |
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit a158036. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…T_OBJECT (Python 3.15) (apache#48027) ### Rationale for this change pyarrow builds fail on CPython 3.15 due to the 3.15's removal of PyWeakref_GetObject, used in extension_types.cc. This was deprecated in 3.13. A backport is available in the already-vendored [pythoncapi_compat](https://github.com/apache/arrow/blob/main/python/pyarrow/src/arrow/python/vendored/pythoncapi_compat.h). Fixes apache#47823. To be clear: this fixes only the build issue reported in the issue, not "3.15 support". ### What changes are included in this PR? Replaces the sole use of PyWeakref_GET_OBJECT with the backported version of PyWeakref_GetRef. This follows the recommendation from [Pending removal in Python 3.15](https://docs.python.org/3/deprecations/c-api-pending-removal-in-3.15.html) > [PyWeakref_GetObject()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject) and [PyWeakref_GET_OBJECT()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GET_OBJECT): Use [PyWeakref_GetRef()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetRef) instead. The [pythoncapi-compat project](https://github.com/python/pythoncapi-compat/) can be used to get [PyWeakref_GetRef()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetRef) on Python 3.12 and older. ### Are these changes tested? Build and tested on a local Ubuntu 24.04 build. ### Are there any user-facing changes? No user-facing changes. * GitHub Issue: apache#47823 Authored-by: paultiq <[email protected]> Signed-off-by: AlenkaF <[email protected]>
…T_OBJECT (Python 3.15) (apache#48027) ### Rationale for this change pyarrow builds fail on CPython 3.15 due to the 3.15's removal of PyWeakref_GetObject, used in extension_types.cc. This was deprecated in 3.13. A backport is available in the already-vendored [pythoncapi_compat](https://github.com/apache/arrow/blob/main/python/pyarrow/src/arrow/python/vendored/pythoncapi_compat.h). Fixes apache#47823. To be clear: this fixes only the build issue reported in the issue, not "3.15 support". ### What changes are included in this PR? Replaces the sole use of PyWeakref_GET_OBJECT with the backported version of PyWeakref_GetRef. This follows the recommendation from [Pending removal in Python 3.15](https://docs.python.org/3/deprecations/c-api-pending-removal-in-3.15.html) > [PyWeakref_GetObject()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject) and [PyWeakref_GET_OBJECT()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GET_OBJECT): Use [PyWeakref_GetRef()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetRef) instead. The [pythoncapi-compat project](https://github.com/python/pythoncapi-compat/) can be used to get [PyWeakref_GetRef()](https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetRef) on Python 3.12 and older. ### Are these changes tested? Build and tested on a local Ubuntu 24.04 build. ### Are there any user-facing changes? No user-facing changes. * GitHub Issue: apache#47823 Authored-by: paultiq <[email protected]> Signed-off-by: AlenkaF <[email protected]>
Rationale for this change
pyarrow builds fail on CPython 3.15 due to the 3.15's removal of PyWeakref_GetObject, used in extension_types.cc. This was deprecated in 3.13. A backport is available in the already-vendored pythoncapi_compat.
Fixes #47823. To be clear: this fixes only the build issue reported in the issue, not "3.15 support".
What changes are included in this PR?
Replaces the sole use of PyWeakref_GET_OBJECT with the backported version of PyWeakref_GetRef.
This follows the recommendation from Pending removal in Python 3.15
Are these changes tested?
Build and tested on a local Ubuntu 24.04 build.
Are there any user-facing changes?
No user-facing changes.