Skip to content

GH-50277: [CI][Python] Avoid using generators for test parametrization on newer Pytest#50278

Merged
raulcd merged 2 commits into
apache:mainfrom
raulcd:GH-50277
Jun 30, 2026
Merged

GH-50277: [CI][Python] Avoid using generators for test parametrization on newer Pytest#50278
raulcd merged 2 commits into
apache:mainfrom
raulcd:GH-50277

Conversation

@raulcd

@raulcd raulcd commented Jun 29, 2026

Copy link
Copy Markdown
Member

Rationale for this change

On the hypothesis tests we treat Warnings as errors and the job has been failing with the latest Pytest version (9.1.0). This is related to:

With the latest pytest using generators for parametrization has been deprecated.

What changes are included in this PR?

Change the generator that was causing the failures and return a list of supported_factories instead.

Are these changes tested?

Yes both locally and the archery test that was failing.

Are there any user-facing changes?

No

Copilot AI review requested due to automatic review settings June 29, 2026 09:45
@raulcd raulcd requested review from AlenkaF and rok as code owners June 29, 2026 09:45
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50277 has been automatically assigned in GitHub to PR creator.

@raulcd

raulcd commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-conda-python-3.11-hypothesis

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.

Pull request overview

This PR updates PyArrow’s Python memory-pool tests to avoid passing a generator into pytest.mark.parametrize, which triggers PytestRemovedIn10Warning (treated as errors in CI) on newer pytest versions.

Changes:

  • Convert supported_factories() from a generator (yield) to a concrete list-returning function.
  • Collect supported memory pool factory callables into a list before returning, ensuring parametrize receives a Collection.

@github-actions

Copy link
Copy Markdown

Revision: cdb6e0e

Submitted crossbow builds: ursacomputing/crossbow @ actions-b28209428c

Task Status
test-conda-python-3.11-hypothesis GitHub Actions

@raulcd raulcd changed the title GH-50277: [CI][Python] Avoid using generators for fixtures on newer Pytest GH-50277: [CI][Python] Avoid using generators for test parametrization on newer Pytest Jun 29, 2026
@raulcd

raulcd commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

@AlenkaF if you can take a quick look

Comment thread python/pyarrow/tests/test_memory.py Outdated
@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Jun 29, 2026
@github-actions github-actions Bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Jun 29, 2026
@raulcd

raulcd commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-conda-python-3.11-hypothesis

@github-actions

Copy link
Copy Markdown

Revision: b716114

Submitted crossbow builds: ursacomputing/crossbow @ actions-966d54caba

Task Status
test-conda-python-3.11-hypothesis GitHub Actions

@raulcd raulcd merged commit 3f4a04e into apache:main Jun 30, 2026
17 checks passed
@raulcd raulcd removed the awaiting merge Awaiting merge label Jun 30, 2026
@raulcd raulcd deleted the GH-50277 branch June 30, 2026 07:22
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 3f4a04e.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

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.

4 participants