Skip to content

GH-49153: [Python] Remove APIs deprecated before 15.0.0 - #53543

Open
rok wants to merge 3 commits into
apache:mainfrom
rok:python-remove-old-deprecations
Open

rok wants to merge 3 commits into
apache:mainfrom
rok:python-remove-old-deprecations

Conversation

@rok

@rok rok commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Rationale for this change

We have many deprecated APIs in Python we should slowly remove.

What changes are included in this PR?

Several deprecation messages are acted on.

Are these changes tested?

By the existing test suite.

Are there any user-facing changes?

Yes, some deprecated user-facing APIs are.removed.

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

rok added 2 commits October 13, 2026 11:53
Remove Python APIs whose deprecation period has long expired:
Schema.field_by_name, Schema.add_metadata, ChunkedArray.data,
ChunkedArray.format, UnionArray.child, Table.from_arrays(names=Schema),
concat_tables(promote=), CumulativeSumOptions, Flight write_table(chunksize=),
FlightClient.connect, FlightServer.run, orc.write_table swapped arguments,
parquet._filters_to_expression, and the FutureWarning for pandas Categorical
conversion with a mismatched value_type, which now raises.
The promote= handling was deleted but the signature still swallowed
unknown keywords, so promote=True was silently ignored.
@rok

rok commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

@pitrou

@rok

rok commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

@jorisvandenbossche - does this look approximately right?


_filters_to_expression = _deprecate_api(
"_filters_to_expression", "filters_to_expression",
filters_to_expression, "10.0.0", DeprecationWarning)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one is still using DeprecationWarning, we might want to leave this one in place but using FutureWarning for a few more releases before removing.

All the others looks good!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Pushed 87b2431 :)

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Oct 13, 2026
Per review, retain the alias for a few more releases but upgrade the
warning from DeprecationWarning to FutureWarning so users see it before
removal. Add a test covering the alias and warning type.
@rok
rok force-pushed the python-remove-old-deprecations branch from 784670f to 87b2431 Compare October 13, 2026 14:38
@github-actions github-actions Bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels Oct 13, 2026
@github-actions github-actions Bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Oct 23, 2026
@rok
rok marked this pull request as ready for review October 23, 2026 09:40
Copilot AI balanced review requested due to automatic review settings October 23, 2026 09:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

Static review found no blocking issues in the targeted compatibility removals and corresponding test and documentation updates; runtime tests were not executed.

No open issues 🎉

What changed in this PR

Removes Python APIs deprecated before 15.0.0, advancing GH-49153’s cleanup of legacy compatibility behavior in PyArrow.

Changes:

  • Removes deprecated methods, options, and argument compatibility across arrays, tables, schemas, compute, ORC, and Flight.
  • Updates tests and compute API documentation to reflect the removals.
  • Retains Parquet’s _filters_to_expression alias but changes its warning to FutureWarning and adds coverage.
File Description
python/​pyarrow/​types.pxi Removes deprecated Schema methods.
python/​pyarrow/​tests/​test_table.py Verifies rejection of the removed promote keyword.
python/​pyarrow/​tests/​test_schema.py Checks that deprecated Schema methods are absent.
python/​pyarrow/​tests/​test_pandas.py Tests rejection of incompatible categorical value types.
python/​pyarrow/​tests/​test_orc.py Replaces legacy argument-order tests with rejection coverage.
python/​pyarrow/​tests/​test_compute.py Removes deprecated options warning and representation exceptions.
python/​pyarrow/​tests/​test_array.py Removes the obsolete ChunkedArray.data test.
python/​pyarrow/​tests/​parquet/​test_basic.py Tests the retained alias’s warning and result.
python/​pyarrow/​table.pxi Removes deprecated ChunkedArray and table compatibility APIs.
python/​pyarrow/​parquet/​core.py Changes the retained alias to emit FutureWarning.
python/​pyarrow/​orc.py Removes support for swapped write arguments.
python/​pyarrow/​compute.py Removes the deprecated options export.
python/​pyarrow/​array.pxi Removes categorical conversion fallback and UnionArray.child.
python/​pyarrow/​_flight.pyx Removes deprecated Flight methods and the chunksize alias.
python/​pyarrow/​_compute.pyx Removes CumulativeSumOptions.
docs/​source/​python/​api/​compute.rst Removes the deleted options class from API documentation.

Review effort: Balanced

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.

5 participants