rok opened a new pull request, #55905:
URL: https://github.com/apache/arrow/pull/55905
### Rationale for this change
Allow running PyArrow tests without NumPy by exposing Arrow's C++
`RandomArrayGenerator` for test data generation instead of relying on
`numpy.random`.
### What changes are included in this PR?
- Decouple `arrow/testing/random.{h,cc}` from GTest, move it into
`libarrow`, and add status-returning `TryArrayOf` / `TryBatchOf`.
- Expose an experimental `pyarrow.testing` module (`RandomArrayGenerator`,
`generate_array`, `generate_batch`, `generate_table`).
- Replace `np.random` across PyArrow test utilities (`parquet/common.py`)
and tests, removing obsolete `@pytest.mark.numpy` markers.
Open questions for reviewers (related to #33538, #38748):
- Is moving `testing/random.cc` into `libarrow` acceptable, or should this
stay internal/separate?
### Are these changes tested?
Yes — added C++ (`arrow-random-test`) and NumPy-free Python tests
(`test_testing.py`), and verified affected PyArrow test suites with `numpy`
blocked.
### Are there any user-facing changes?
Adds an experimental `pyarrow.testing` module.
### Was AI used for this PR?
**PR code and description written by:**
- [ ] Human
- [x] AI
**Reviewed before submission by:**
- [ ] Human
- [x] AI
- [ ] Not reviewed
* GitHub Issue: #47255
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]