Skip to content

Commit 43f650e

Browse files
eschcamdongjoon-hyun
authored andcommitted
[SPARK-52844][PYTHON] Update numpy to 1.22
### What changes were proposed in this pull request? Update numpy from 1.21 to 1.22 ### Why are the changes needed? Numpy 1.21 contains CVE-2021-34141. Version 1.22 removes it ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Passed all CI tests ### Was this patch authored or co-authored using generative AI tooling? No Closes #51990 from eschcam/py-nump-update. Authored-by: eschcam <cameron.scholes@est.tech> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 parent 72c1d41 commit 43f650e

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

.github/workflows/build_and_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ jobs:
362362
- name: Install Python packages (Python 3.11)
363363
if: (contains(matrix.modules, 'sql') && !contains(matrix.modules, 'sql-')) || contains(matrix.modules, 'connect') || contains(matrix.modules, 'yarn')
364364
run: |
365-
python3.11 -m pip install 'numpy>=1.20.0' pyarrow pandas scipy unittest-xml-reporting 'lxml==4.9.4' 'grpcio==1.67.0' 'grpcio-status==1.67.0' 'protobuf==5.29.1'
365+
python3.11 -m pip install 'numpy>=1.22' pyarrow pandas scipy unittest-xml-reporting 'lxml==4.9.4' 'grpcio==1.67.0' 'grpcio-status==1.67.0' 'protobuf==5.29.1'
366366
python3.11 -m pip list
367367
# Run the tests.
368368
- name: Run tests
@@ -1036,7 +1036,7 @@ jobs:
10361036
# Should unpin 'sphinxcontrib-*' after upgrading sphinx>5
10371037
python3.9 -m pip install 'sphinx==4.5.0' mkdocs 'pydata_sphinx_theme>=0.13' sphinx-copybutton nbsphinx numpydoc jinja2 markupsafe 'pyzmq<24.0.0' 'sphinxcontrib-applehelp==1.0.4' 'sphinxcontrib-devhelp==1.0.2' 'sphinxcontrib-htmlhelp==2.0.1' 'sphinxcontrib-qthelp==1.0.3' 'sphinxcontrib-serializinghtml==1.1.5'
10381038
python3.9 -m pip install ipython_genutils # See SPARK-38517
1039-
python3.9 -m pip install sphinx_plotly_directive 'numpy>=1.20.0' pyarrow pandas 'plotly<6.0.0'
1039+
python3.9 -m pip install sphinx_plotly_directive 'numpy>=1.22' pyarrow pandas 'plotly<6.0.0'
10401040
python3.9 -m pip install 'docutils<0.18.0' # See SPARK-39421
10411041
- name: List Python packages for branch-3.5 and branch-4.0
10421042
if: inputs.branch == 'branch-3.5' || inputs.branch == 'branch-4.0'

.github/workflows/maven_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
- name: Install Python packages (Python 3.11)
182182
if: contains(matrix.modules, 'resource-managers#yarn') || (contains(matrix.modules, 'sql#core')) || contains(matrix.modules, 'connect')
183183
run: |
184-
python3.11 -m pip install 'numpy>=1.20.0' pyarrow pandas scipy unittest-xml-reporting 'grpcio==1.67.0' 'grpcio-status==1.67.0' 'protobuf==5.29.1'
184+
python3.11 -m pip install 'numpy>=1.22' pyarrow pandas scipy unittest-xml-reporting 'grpcio==1.67.0' 'grpcio-status==1.67.0' 'protobuf==5.29.1'
185185
python3.11 -m pip list
186186
# Run the tests.
187187
- name: Run tests

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- name: Install Python dependencies
6262
run: |
6363
pip install 'sphinx==4.5.0' mkdocs 'pydata_sphinx_theme>=0.13' sphinx-copybutton nbsphinx numpydoc jinja2 markupsafe 'pyzmq<24.0.0' \
64-
ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.20.0' pyarrow 'pandas==2.3.1' 'plotly>=4.8' 'docutils<0.18.0' \
64+
ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.22' pyarrow 'pandas==2.3.1' 'plotly>=4.8' 'docutils<0.18.0' \
6565
'flake8==3.9.0' 'mypy==1.8.0' 'pytest==7.1.3' 'pytest-mypy-plugins==1.9.3' 'black==23.12.1' \
6666
'pandas-stubs==1.2.0.53' 'grpcio==1.67.0' 'grpcio-status==1.67.0' 'protobuf==5.29.1' 'grpc-stubs==1.24.11' 'googleapis-common-protos-stubs==2.2.0' \
6767
'sphinxcontrib-applehelp==1.0.4' 'sphinxcontrib-devhelp==1.0.2' 'sphinxcontrib-htmlhelp==2.0.1' 'sphinxcontrib-qthelp==1.0.3' 'sphinxcontrib-serializinghtml==1.1.5'

dev/create-release/spark-rm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ RUN python3.10 -m pip install $BASIC_PIP_PKGS unittest-xml-reporting $CONNECT_PI
118118
# See 'ipython_genutils' in SPARK-38517
119119
# See 'docutils<0.18.0' in SPARK-39421
120120
RUN python3.10 -m pip install 'sphinx==4.5.0' mkdocs 'pydata_sphinx_theme>=0.13' sphinx-copybutton nbsphinx numpydoc jinja2 markupsafe 'pyzmq<24.0.0' \
121-
ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.20.0' pyarrow pandas 'plotly>=4.8' 'docutils<0.18.0' \
121+
ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.22' pyarrow pandas 'plotly>=4.8' 'docutils<0.18.0' \
122122
'flake8==3.9.0' 'mypy==1.8.0' 'pytest==7.1.3' 'pytest-mypy-plugins==1.9.3' 'black==23.12.1' \
123123
'pandas-stubs==1.2.0.53' 'grpcio==1.67.0' 'grpc-stubs==1.24.11' 'googleapis-common-protos-stubs==2.2.0' \
124124
'sphinxcontrib-applehelp==1.0.4' 'sphinxcontrib-devhelp==1.0.2' 'sphinxcontrib-htmlhelp==2.0.1' 'sphinxcontrib-qthelp==1.0.3' 'sphinxcontrib-serializinghtml==1.1.5'

dev/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
py4j>=0.10.9.9
33

44
# PySpark dependencies (optional)
5-
numpy>=1.21
5+
numpy>=1.22
66
pyarrow>=15.0.0
77
six==1.16.0
88
pandas>=2.2.0

dev/spark-test-image/docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
8888
# See 'ipython_genutils' in SPARK-38517
8989
# See 'docutils<0.18.0' in SPARK-39421
9090
RUN python3.11 -m pip install 'sphinx==4.5.0' mkdocs 'pydata_sphinx_theme>=0.13' sphinx-copybutton nbsphinx numpydoc jinja2 markupsafe 'pyzmq<24.0.0' \
91-
ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.20.0' pyarrow 'pandas==2.3.1' 'plotly>=4.8' 'docutils<0.18.0' \
91+
ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.22' pyarrow 'pandas==2.3.1' 'plotly>=4.8' 'docutils<0.18.0' \
9292
'flake8==3.9.0' 'mypy==1.8.0' 'pytest==7.1.3' 'pytest-mypy-plugins==1.9.3' 'black==23.12.1' \
9393
'pandas-stubs==1.2.0.53' 'grpcio==1.67.0' 'grpcio-status==1.67.0' 'protobuf==5.29.1' 'grpc-stubs==1.24.11' 'googleapis-common-protos-stubs==2.2.0' \
9494
'sphinxcontrib-applehelp==1.0.4' 'sphinxcontrib-devhelp==1.0.2' 'sphinxcontrib-htmlhelp==2.0.1' 'sphinxcontrib-qthelp==1.0.3' 'sphinxcontrib-serializinghtml==1.1.5' \

python/docs/source/getting_started/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ Installable with ``pip install "pyspark[ml]"``.
277277
======= ================= ======================================
278278
Package Supported version Note
279279
======= ================= ======================================
280-
`numpy` >=1.21 Required for MLlib DataFrame-based API
280+
`numpy` >=1.22 Required for MLlib DataFrame-based API
281281
======= ================= ======================================
282282

283283
Additional libraries that enhance functionality but are not included in the installation packages:
@@ -297,7 +297,7 @@ Installable with ``pip install "pyspark[mllib]"``.
297297
======= ================= ==================
298298
Package Supported version Note
299299
======= ================= ==================
300-
`numpy` >=1.21 Required for MLlib
300+
`numpy` >=1.22 Required for MLlib
301301
======= ================= ==================
302302

303303
Declarative Pipelines

python/pyspark/sql/pandas/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def require_minimum_pyarrow_version() -> None:
9898

9999
def require_minimum_numpy_version() -> None:
100100
"""Raise ImportError if minimum version of NumPy is not installed"""
101-
minimum_numpy_version = "1.21"
101+
minimum_numpy_version = "1.22"
102102

103103
try:
104104
import numpy

0 commit comments

Comments
 (0)