Repository navigation
Pin pyarrow<26 and pandas<3 for the Ubuntu 24.04 image - #3990
Merged
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3990
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 9287967 with merge base db4c5a1 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
The Ubuntu 24.04 image (pytorch#3988) pins numpy==1.26.4, because numba 0.59.1 and spacy 3.7.2 need numpy < 2. pyarrow's wheels declare no numpy requirement, so pip installs the latest pyarrow, 26.0.0, which fails at import with "pyarrow requires NumPy 2.0 or newer, found 1.26.4". ray.train reports any failure to import fsspec, pandas, pyarrow or requests as "Can't import ray.train as some dependencies are missing", so beginner_source/distributed_training_with_ray_tutorial.py failed the Build tutorials job on main: https://github.com/pytorch/tutorials/actions/runs/40763826746/job/123082673219 Cap pyarrow below 26. Drop the cap when numpy moves to 2.x. Alternative considered: moving numpy to 2.x. That needs new numba and spacy, which is a much larger change to the tutorial environment. Test Plan: In a Python 3.12 venv with numpy==1.26.4, ray[train]==2.55.0, pandas==3.0.6, fsspec and requests: ``` python -c "import pyarrow" # 26.0.0: ImportError, NumPy 2.0 required python -c "import pyarrow" # 22.0.0 to 25.0.0: ok python -c "import ray.train" # with pyarrow<26: ok ``` The image has not been rebuilt: run the Docker Build workflow on this PR, then the tutorial build, to verify. This change was authored with an AI assistant (Claude Code).
atalman
force-pushed
the
pin-pyarrow-lt-26
branch
from
October 28, 2026 21:40
3eafe87 to
67fe971
Compare
atalman
marked this pull request as ready for review
October 28, 2026 21:40
huydhn
approved these changes
Oct 28, 2026
On the Python 3.12 image nothing caps pandas, so pip installs 3.0.x. pandas
3.0 uses copy-on-write, which makes Series.values and to_numpy() return
read-only arrays. Ax 0.4.3 builds ObservationData.means from
d["mean"].values and then assigns into it in its winsorize transform, so
intermediate_source/ax_multiobjective_nas_tutorial.py fails with
"ValueError: assignment destination is read-only".
Cap pandas below 3. ax-platform<0.5 declares an unbounded pandas
requirement, so pip does not catch this. Drop the cap when the tutorial
moves to an Ax release that works with pandas 3.
Test Plan:
In a Python 3.12 venv with pandas 3.0.6:
```
python -c "import pandas as pd; a=pd.DataFrame({'m':[1.0]})['m'].to_numpy(); a[0]=5.0"
```
fails with "assignment destination is read-only". A resolve of
.ci/docker/requirements.txt with torch 2.14.1 standing in for 2.15:
```
uv pip compile .ci/docker/requirements.txt --python-version 3.12 --python-platform x86_64-manylinux_2_39
```
gives pandas 2.3.3, pyarrow 25.0.1, numpy 1.26.4 and ax-platform 0.4.3. The
Build tutorials run on this PR is the end to end check.
This change was authored with an AI assistant (Claude Code).
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.
Follow-up to #3988. Fixes the failing Build tutorials job on
main: https://github.com/pytorch/tutorials/actions/runs/40763826746/job/123082673219 and https://github.com/pytorch/tutorials/actions/runs/40773662620Description
#3988 moved the CI image to Ubuntu 24.04 (Python 3.12) and pinned
numpy==1.26.4. Nothing caps the other packages, so pip resolves newer majors that do not work with it. Two caps in.ci/docker/requirements.txtfix the four failing tutorials:pyarrow<26:pyarrow26.0.0 raisesImportError: pyarrow requires NumPy 2.0 or newer, found 1.26.4. Its wheels declare no numpy requirement, so pip installs it anyway. This brokedistributed_training_with_ray_tutorial,hyperparameter_tuning_tutorialandserving_tutorial.ray.trainandray.tunereport any failure to importfsspec,pandas,pyarroworrequestsas "dependencies are missing", which hides the real error.pandas<3: pandas 3.0 makesSeries.valuesread-only (copy-on-write). Ax 0.4.3 builds its observation means fromd["mean"].valuesand assigns into them in its winsorize transform, soax_multiobjective_nas_tutorialfails withValueError: assignment destination is read-only.Both caps can come out when numpy moves to 2.x (and, for pandas, when the Ax tutorial moves to an Ax release that works with pandas 3).
Alternative: move numpy to 2.x, which needs new numba and spacy and is a much larger change.
Checked in a Python 3.12 venv with numpy 1.26.4:
pyarrow26.0.0 fails to import and 22.0.0 to 25.0.0 import fine,import ray.trainpasses with the cap, andto_numpy()is read-only under pandas 3.0.6. A resolve ofrequirements.txtgives pandas 2.3.3, pyarrow 25.0.1, numpy 1.26.4. On the first run of this PR thepyarrowshards (1 and 9) passed and the Ax shard (4) failed; the second commit adds the pandas cap for it.Not verified: the Build tutorials run on the latest commit of this PR.
Checklist