Skip to content

GH-47255: [C++][Python] Expose RandomArrayGenerator in pyarrow.testing - #55905

Draft
rok wants to merge 1 commit into
apache:mainfrom
rok:gh-47255-random-array-generator
Draft

rok wants to merge 1 commit into
apache:mainfrom
rok:gh-47255-random-array-generator

Conversation

@rok

@rok rok commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

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 and move it into libarrow.
  • Expose an experimental pyarrow.testing.RandomArrayGenerator (array_of, batch_of, table_of) with Python-side argument validation.
  • Plug it into _test_table / _test_dataframe (parquet/common.py) and a util.random_array test helper, and remove 18 obsolete @pytest.mark.numpy markers across parquet, feather, io, and json tests.

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 — ran C++ arrow-random-test (and verified libarrow has no GTest linkage), added NumPy-free Python tests (test_testing.py), and verified all 18 unmarked tests pass 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
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@rok
rok force-pushed the gh-47255-random-array-generator branch 4 times, most recently from df04121 to 40e0437 Compare December 3, 2026 12:11
@rok

rok commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

@egolearner would you be interested to review this?

@rok
rok force-pushed the gh-47255-random-array-generator branch from 40e0437 to 58b65a8 Compare December 3, 2026 14:13
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.

[Python] Add a dependency free random array generator for testing

1 participant