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

Merged
merged 2 commits into from
Apr 29, 2025

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

Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove it from the docs?

@raulcd
Copy link
Member

raulcd commented Apr 28, 2025

@github-actions crossbow submit -g python

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Apr 28, 2025
Copy link

Revision: b4b3728

Submitted crossbow builds: ursacomputing/crossbow @ actions-2813be5290

Task Status
example-python-minimal-build-fedora-conda GitHub Actions
example-python-minimal-build-ubuntu-venv GitHub Actions
test-conda-python-3.10 GitHub Actions
test-conda-python-3.10-hdfs-2.9.2 GitHub Actions
test-conda-python-3.10-hdfs-3.2.1 GitHub Actions
test-conda-python-3.10-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.11 GitHub Actions
test-conda-python-3.11-dask-latest GitHub Actions
test-conda-python-3.11-dask-upstream_devel GitHub Actions
test-conda-python-3.11-hypothesis GitHub Actions
test-conda-python-3.11-pandas-latest-numpy-1.26 GitHub Actions
test-conda-python-3.11-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.11-pandas-nightly-numpy-nightly GitHub Actions
test-conda-python-3.11-pandas-upstream_devel-numpy-nightly GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.12 GitHub Actions
test-conda-python-3.12-cpython-debug GitHub Actions
test-conda-python-3.13 GitHub Actions
test-conda-python-3.9 GitHub Actions
test-conda-python-3.9-pandas-1.1.3-numpy-1.19.5 GitHub Actions
test-conda-python-emscripten GitHub Actions
test-cuda-python-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-debian-12-python-3-amd64 GitHub Actions
test-debian-12-python-3-i386 GitHub Actions
test-fedora-39-python-3 GitHub Actions
test-ubuntu-22.04-python-3 GitHub Actions
test-ubuntu-22.04-python-313-freethreading GitHub Actions
test-ubuntu-24.04-python-3 GitHub Actions

@github-actions github-actions bot added Component: Documentation awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Apr 28, 2025
Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AlenkaF

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Apr 29, 2025
@pitrou pitrou merged commit 26170b4 into apache:main Apr 29, 2025
15 checks passed
@pitrou pitrou removed the awaiting merge Awaiting merge label Apr 29, 2025
@AlenkaF AlenkaF deleted the remove-deprecated-pyextensiontype branch April 29, 2025 08:48
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 26170b4.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

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.

3 participants