16 Commits
Author SHA1 Message Date
b60d43701b GH-48473: [CI][Python] Require numpy 2.0 (#50769)
### Rationale for this change
Require Numpy 2.0 to support newer features, allow newer numpy API/ABI

### What changes are included in this PR?

- Numpy 2.0+ requirement
- Pandas 2.2.2+ requirement (first wheel compatible with numpy 2.0)
- Pyodide 0.27.1 usage (numpy 2.0 api)

### Are there any user-facing changes?
Yes, in contrast to pyarrow 25, after merging this PR pyarrow 26 can't be used with Numpy 1.x or pandas 2.0-2.2.1 

**This PR includes breaking changes to public APIs.**

This PR was created using GPT-5.6-Sol-xhigh, every line read & reviewed by me.
* GitHub Issue: #48473

Lead-authored-by: Adam Lippai <adam@rigo.sk>
Co-authored-by: Ádám Lippai <adam@rigo.sk>
Co-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
2026-08-21 19:16:28 +02:00
Guja 59c3872312 GH-49255: [Python] Fix pandas Categorical DeprecationWarnings in tests (#50543)
### Rationale for this change

pandas 3.0.0 deprecated constructing or casting to a `Categorical` with
non-NA values that are not present in the specified `dtype.categories`. 
This surfaces as DeprecationWarnings in the PyArrow
test suite when run against pandas >= 3.0 (GH-49255), in test_category
and test_category_implicit_from_pandas.

### What changes are included in this PR?

- test_category: remove the `cat_strings_with_na` column (relied on
  silent 'qux' -> NaN; redundant, cat_strings already carries nulls).
- test_category_implicit_from_pandas: use explicit None
  (['a','b',None]) instead of out-of-category 'c'.

### Are these changes tested?
Yes - test-only. Verified no DeprecationWarning under pandas 3.0.3.

### Are there any user-facing changes?
No.

Closes #49255.
* GitHub Issue: #49255

Authored-by: GujaLomsadze <lomsadze.guja@gmail.com>
Signed-off-by: Rok Mihevc <rok@mihevc.org>
2026-07-18 16:39:29 +02:00
Alenka Frim 82847d8f6d GH-49227: [Python] Deprecate pyarrow.gandiva (#49637)
### Rationale for this change
See: https://github.com/apache/arrow/issues/49227#issue-3926177634

### What changes are included in this PR?
Deprecation warnings for `pyarrow.gandiva` added for version 24.0.0

### Are these changes tested?
Yes, tested locally that warnings are raised on import. CI tests verify the warnings are filtered in out test suite.

### Are there any user-facing changes?
Yes, `pyarrow.gandiva` is deprecated and will be removed in a feature PyArrow version.

* GitHub Issue: #49227

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
2026-04-02 09:50:27 +02:00
Patrick J. Roddy 866502e6d6 GH-45867: [Python] Fix SetuptoolsDeprecationWarning (#47141)
### Rationale for this change
When building locally, I get many errors along the lines of

```
Please ensure the files specified are contained by the root
of the Python package (normally marked by `pyproject.toml`).

By 2026-Mar-20, you need to update your project and remove deprecated calls
or your builds will no longer be supported.

See https://packaging.python.org/en/latest/specifications/glob-patterns/ for details.
```

<img width="958" height="755" alt="terminal demo" src="https://github.com/user-attachments/assets/67f0e261-c4d2-403c-b004-688dfaaccda6" />

### What changes are included in this PR?
- Make the licence [SPDX compliant](https://spdx.org/licenses)
- Remove the licence classifier
- Move the licence files from `setup.cfg` to `pyproject.toml`
- Fix the [disallowed glob patterns](https://packaging.python.org/en/latest/specifications/glob-patterns) via symlinks
- Bumped the minimum version of `setuptools` due to macOS CI failures (don't know why this happened, caching maybe?)

I appreciate the symlink change might prove controversial. See discussions in https://github.com/apache/arrow/issues/45867, fixes https://github.com/apache/arrow/issues/45867.

### Are these changes tested?
When I rebuild locally, I get no errors any more.

### Are there any user-facing changes?
Yes. The minimum required version of `setuptools` is now `77`. However, this is available on `>=3.9` so won't affect anyone really.

* GitHub Issue: #45867

Authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2025-12-18 13:11:45 +01:00
f325ce95a2 GH-38239: [CI][Python] Disable -W error on Python CI jobs temporarily (#38238)
* Closes: #38239

Lead-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Co-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Co-authored-by: Jacob Wujciak-Jens <jacob@wujciak.de>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
2023-10-16 10:33:22 +02:00
Joris Van den Bossche 0ead719bdc GH-33976: [Python] Refactor the internal usage of ExecPlan to use new Acero Declaration/ExecNodeOptions bindings (#34401)
This PR refactors our current custom cython implementation of the Table/Dataset.filter/join/group_by/sort_by methods to use the new bindings for Declaration/ExecNodeOptions (https://github.com/apache/arrow/pull/34102).

* Issue: #33976

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2023-03-28 13:41:44 +02:00
Joris Van den Bossche 1e15f07954 ARROW-18394: [Python][CI] Fix nightly job using pandas dev (temporarily skip tests) (#15048)
Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2022-12-22 20:34:12 +01:00
Miles Granger 3e2a2242d5 MINOR: [Python] Bump max_line_length = 88 (#14769)
Authored-by: Miles Granger <miles59923@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2022-12-12 20:24:28 +01:00
Antoine Pitrou b0422e5feb ARROW-17435: [CI][Python][CUDA] Install Numba for CUDA interop tests (#13899)
Checked locally on a Ubuntu 20.04 host with:
```
archery docker run ubuntu-cuda-python
```

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2022-08-17 15:37:16 +02:00
Antoine Pitrou 1164079d54 ARROW-8846: [Dev][Python] Autoformat Python files with archery
`archery lint --flake8` becomes `archery lint --python` and now recognizes the `--fix` option.

Reformatting involves running `autopep8`.

Closes #7215 from pitrou/ARROW-8846-archery-autopep8

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2020-05-19 09:33:39 +02:00
Joris Van den Bossche 9736d3cd1a ARROW-6556: [Python] Fix warning for pandas SparseDataFrame removal
Follow-up on https://issues.apache.org/jira/browse/ARROW-6556 / https://github.com/apache/arrow/pull/5377.
We were a bit fast with merging the other PR, as pandas changed the removal slightly (it added back a dummy SparseDataFrame object which triggers a warning upon access, but this means that `hasattr(pd, 'SparseDataFrame)` or try/except on import is not a good check to know if the actual class still exists or not).

Using pytests warnings filter I now ensure no such warning is raised in our test suite.

Closes #5438 from jorisvandenbossche/ARROW-6556-fix-warning and squashes the following commits:

06a073806 <Joris Van den Bossche> ARROW-6556:  Fix warning for pandas SparseDataFrame removal

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
2019-09-19 16:38:19 -05:00
Krisztián Szűcs a1f96d1233 ARROW-5934: [Python] Bundle arrow's LICENSE with the wheels
Setuptools can handle multiple license files, but they get overwritten because of the same naming, so move the content python/LICENSE.txt to the top level LICENSE.txt.  I've investigated a solution to concatenate these, but it would require to extend multiple distutils/setuptools/wheel commands in a really error-prone fashion.
- Distribute the top level LICENSE.txt file with the wheels
- Distribute the top level LICENSE.txt with the source distribution, however `python setup.py bdist` leaves LICENSE.txt file as a garbage in the rebository, it cannot cleanup properly probably because the relative directory reference.

Add 3rdparty licenses because of the static-linkage in the wheels:
- lz4: https://github.com/lz4/lz4/blob/dev/lib/LICENSE#L11-L13
- zstd: https://github.com/facebook/zstd/blob/dev/LICENSE#L13-L15
- rapidjson: because of transitive dependencies https://github.com/Tencent/rapidjson/blob/master/license.txt#L21
- uriparser: https://github.com/uriparser/uriparser/blob/master/COPYING#L15-L18
- double-conversion: https://github.com/google/double-conversion/blob/3f9cd30e1bca91c0a036ad8b2b7eb8e2d2290dd2/LICENSE#L8-L11
- snappy: https://github.com/google/snappy/blob/master/COPYING#L10-L13
- brotli: https://github.com/google/brotli/blob/master/LICENSE#L10
- jemalloc is already added
- protobuf is already added
- gflags: https://github.com/gflags/gflags/blob/master/COPYING.txt#L10-L13
- c-ares: https://github.com/c-ares/c-ares/blob/master/LICENSE.md
- glog: https://github.com/google/glog/blob/master/COPYING#L10-L13
- boost is already added
- flatbuffers is already added
- grpc: https://github.com/grpc/grpc/blob/master/NOTICE.txt
- gtest: do we redistribute any binaries from it?
- gbenchmark: do we redistribute any binaries from it?
- apache thrift added
- apache orc added
- zlip is redistributed as a shared library with all wheels (in the future we should switch to static linkage)
- openssl and libcrypto is redistributed as shared libraries with the windows wheels, so added the openssl license preceding version 3

bzip2 doesn't require to include its license with binary redistributions: https://github.com/asimonov-im/bzip2/blob/master/LICENSE

Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
Signed-off-by: Wes McKinney <wesm+git@apache.org>

Closes #4880 from kszucs/wheel-license and squashes the following commits:

b839964a2 <Krisztián Szűcs> openssl
f220c6609 <Krisztián Szűcs> zlib
064444d25 <Krisztián Szűcs> distribute notice as well
bee17ac0e <Krisztián Szűcs> orc notice
25f738cf8 <Krisztián Szűcs> Thrift and ORC
54a643bd8 <Krisztián Szűcs> grpc
baa77962f <Krisztián Szűcs> glog
0a3070e5a <Krisztián Szűcs> c-ares
749574f00 <Krisztián Szűcs> gflags
52d7e19a8 <Krisztián Szűcs> typo
0697927c6 <Krisztián Szűcs> brotli
51b9264fe <Krisztián Szűcs> re2
5418a0e2c <Krisztián Szűcs> snappy and double-conversion
5647ab923 <Krisztián Szűcs> lz4 and rapidjson
29fa7e046 <Krisztián Szűcs> wheel licensing
2019-07-15 13:48:22 -05:00
Phillip Cloud 4381845b5e ARROW-1033: [Python] pytest discovers scripts/test_leak.py
Author: Phillip Cloud <cpcloud@gmail.com>

Closes #689 from cpcloud/ARROW-1033 and squashes the following commits:

60a3bc3 [Phillip Cloud] ARROW-1033: [Python] pytest discovers scripts/test_leak.py
2017-05-15 16:16:01 -04:00
Uwe L. Korn 73455b56f7 ARROW-430: Improved version handling
This reintroduces `setuptools_scm` versioning for git clones and sdists/wheels. git-archives are handled by a separate chunk of code that will infer the version from the `pom.xml`

As in the Maven world, always the next to-be-released version is specified and Python PEP 440 development versions are based on the previous release, it used the most minimal pre-release version specified there.

I would suggest to keep the conda package versioning as it is currently, i.e. manually set it to 0.1.0postX.

Also: I would rather not parse the Maven XML but that is the most simple way currently to ensure that the versioning system is in a state where we can still make releases with the Maven release plugin.

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #248 from xhochy/ARROW-430 and squashes the following commits:

39753f8 [Uwe L. Korn] Infer version from java/pom.xml
05c44ea [Uwe L. Korn] Get rid of setuptools_scm_git_archive
14b8136 [Uwe L. Korn] Revert "ARROW-429: Revert ARROW-379 until git-archive issues are resolved"

Change-Id: I4f6d291e63b2518af47c2a81049aa24a38c92821
2016-12-20 16:19:26 -05:00
Wes McKinney 68e39c6868 ARROW-429: Revert ARROW-379 until git-archive issues are resolved
These changes are resulting in GitHub producing archive tarballs with non-deterministic contents.

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #243 from wesm/ARROW-429 and squashes the following commits:

49f6edb [Wes McKinney] Revert "ARROW-379: Use setuptools_scm for Python versioning"
2016-12-19 21:11:25 +01:00
Uwe L. Korn 0ac01a5bf6 ARROW-379: Use setuptools_scm for Python versioning
Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #224 from xhochy/ARROW-379 and squashes the following commits:

3a68d9f [Uwe L. Korn] Remove deprecated version import
15fe9b2 [Uwe L. Korn] Add license header
aa9bd49 [Uwe L. Korn] ARROW-379: Use setuptools_scm for Python versioning
2016-12-04 10:50:43 -05:00