Skip to content

GH-46198: [Python] Remove deprecated PyExtensionType #46199

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlenkaF
Copy link
Member

@AlenkaF AlenkaF commented Apr 22, 2025

Rationale for this change

PyExtensionType has been deprecated in #38608 and can now be removed.

What changes are included in this PR?

PyExtensionType functionality is removed from PyArrow code.

Are these changes tested?

Existing tests should pass.

Are there any user-facing changes?

Deprecated classes are removed.

@AlenkaF AlenkaF marked this pull request as ready for review April 22, 2025 13:15
@AlenkaF AlenkaF requested review from raulcd and rok as code owners April 22, 2025 13:15
@AlenkaF AlenkaF requested a review from pitrou April 22, 2025 13:15
@pitrou
Copy link
Member

pitrou commented Apr 22, 2025

Can you check if it breaks https://pypi.org/project/pyarrow-hotfix/ ?

@AlenkaF
Copy link
Member Author

AlenkaF commented Apr 22, 2025

Yeah, it breaks it:

>>> import pyarrow_hotfix
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/alenkafrim/Envs/pyarrow-dev/lib/python3.12/site-packages/pyarrow_hotfix/__init__.py", line 110, in <module>
    install()
  File "/Users/alenkafrim/Envs/pyarrow-dev/lib/python3.12/site-packages/pyarrow_hotfix/__init__.py", line 66, in install
    pa.unregister_extension_type("arrow.py_extension_type")
  File "pyarrow/types.pxi", line 2281, in pyarrow.lib.unregister_extension_type
    check_status(UnregisterPyExtensionType(c_type_name))
  File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
    raise convert_status(status)
pyarrow.lib.ArrowKeyError: No type extension with name arrow.py_extension_type found

Should I propose an update in the pyarrow-hotfix repo __init__.py for PyArrow versions >= 21.0.0 similar to https://github.com/pitrou/pyarrow-hotfix/blob/main/src/pyarrow_hotfix/__init__.py#L39?

@pitrou
Copy link
Member

pitrou commented Apr 22, 2025

@AlenkaF Yes, please do!

@AlenkaF
Copy link
Member Author

AlenkaF commented Apr 23, 2025

@pitrou, I have submitted pitrou/pyarrow-hotfix#8 (tested locally with the changes in this PR and with pyarrow 19.0.0).

pitrou pushed a commit to pitrou/pyarrow-hotfix that referenced this pull request Apr 25, 2025
In PyArrow version 21.0.0 `PyExtensionType` will be removed, see
apache/arrow#46199. We need to update the checks
in `__init__` so that the hotfix doesn't break with future pyarrow
versions.
@AlenkaF
Copy link
Member Author

AlenkaF commented Apr 25, 2025

As pyarrow-hotfix update has been merged, this PR is ready for review.
cc @raulcd @pitrou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants