Ensure pyarrow.csv is available in tests (if installed)#19052
Merged
Conversation
A `pyarrow` test fails if it is executed before `pyarrow.csv` is imported, which previously could happen if the tests run in parallel. Now the `pyarrow` tests import `pyarrow.csv` at module level (if `pyarrow` is installed`).
Contributor
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
meeseeksmachine
pushed a commit
to meeseeksmachine/astropy
that referenced
this pull request
Dec 17, 2025
… (if installed)
pllim
added a commit
that referenced
this pull request
Dec 17, 2025
…052-on-v7.2.x Backport PR #19052 on branch v7.2.x (Ensure `pyarrow.csv` is available in tests (if installed))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In #19049 the parallel tests CI job failed with
AttributeError: module 'pyarrow' has no attribute 'csv'. This happens if the test in question is executed before anything importspyarrow.csv, which can happen in the parallel tests job where the test execution order is not deterministic. A simple way to prevent this problem is to importpyarrow.csvat the module level.