Repository navigation
GH-49153: [Python] Remove APIs deprecated before 15.0.0 - #53543
Conversation
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.
|
@jorisvandenbossche - does this look approximately right? |
|
|
||
| _filters_to_expression = _deprecate_api( | ||
| "_filters_to_expression", "filters_to_expression", | ||
| filters_to_expression, "10.0.0", DeprecationWarning) |
There was a problem hiding this comment.
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!
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.
784670f to
87b2431
Compare
There was a problem hiding this comment.
🟢 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_expressionalias but changes its warning toFutureWarningand 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
|
@github-actions crossbow submit -g python |
|
Revision: 87b2431 Submitted crossbow builds: ursacomputing/crossbow @ actions-1886325516 |
|
CI failures are unrelated. |
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:
Reviewed before submission by: