Skip to content

Commit 6e2044b

Browse files
Bump lower and upper bounds for pyarrow + related dependencies, remove unnecessary CVE hotfix (#39530)
* Bump lower and upper bounds for pyarrow, remove unnecessary CVE hotfix * tighten bounds further, match with our testing environment * transitive deps * Update sdks/python/setup.py Co-authored-by: Danny McCormick <dannymccormick@google.com> --------- Co-authored-by: Danny McCormick <dannymccormick@google.com>
1 parent 8a1c19b commit 6e2044b

2 files changed

Lines changed: 13 additions & 25 deletions

File tree

sdks/python/setup.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,10 @@ def cythonize(*args, **kwargs):
150150
pyarrow_dependency = ['']
151151
else:
152152
pyarrow_dependency = [
153-
'pyarrow>=6.0.1,<24.0.0',
154-
# NOTE(https://github.com/apache/beam/issues/29392): We can remove this
155-
# once Beam increases the pyarrow lower bound to a version that fixes CVE.
156-
# (lower bound >= 14.0.1)
157-
'pyarrow-hotfix<1'
153+
# Generally try to cover versions released in the last two years.
154+
# Update python/sdks/tox.ini to cover the same pyarrow versions
155+
# when updating the bounds here.
156+
'pyarrow>=14.0.1,<26.0.0',
158157
]
159158

160159
# Exclude pandas<=1.4.2 since it doesn't work with numpy 1.24.x.
@@ -589,17 +588,14 @@ def get_portability_package_data():
589588
# tensorflow-transform requires dill, but doesn't set dill as a
590589
# hard requirement in setup.py.
591590
'dill', # match tft extra.
592-
'tensorflow_transform>=1.14.0,<1.15.0',
593-
# TFT->TFX-BSL require pandas 1.x, which is not compatible
594-
# with numpy 2.x
595-
'numpy<2',
591+
'tensorflow_transform>=1.21.0,<1.22.0',
596592
# Comment out xgboost as it is breaking presubmit python ml
597593
# tests due to tag check introduced since pip 24.2
598594
# https://github.com/apache/beam/issues/31285
599595
# 'xgboost<2.0', # https://github.com/apache/beam/issues/31252
600596
# tft needs protobuf<5; tf2onnx 1.17+ allows protobuf 5 on the
601597
# ADK-only path.
602-
'tf2onnx>=1.16.1,<1.17',
598+
'tf2onnx>=1.17.0,<1.18',
603599
] + ml_base_core,
604600
'p310_ml_test': [
605601
'datatable',
@@ -609,7 +605,7 @@ def get_portability_package_data():
609605
] + ml_base + qdrant_dependency,
610606
# maintainer: milvus tests only run with this extension. Make sure it
611607
# is covered by docker-in-docker test when changing py version
612-
'p313_ml_test': ml_base + milvus_dependency + qdrant_dependency,
608+
'p313_ml_test': ml_base_core + milvus_dependency + qdrant_dependency,
613609
'aws': ['boto3>=1.9,<2'],
614610
'azure': [
615611
'azure-storage-blob>=12.3.2,<13',
@@ -642,7 +638,7 @@ def get_portability_package_data():
642638
# https://docs.google.com/document/d/1c84Gc-cZRCfrU8f7kWGsNR2o8oSRjCM-dGHO9KvPWPw/edit?usp=sharing
643639
'torch': ['torch>=1.9.0,<2.8.0'],
644640
'tensorflow': [
645-
'tensorflow>=2.12rc1,<2.21', # tensorflow transitive dep
641+
'tensorflow>=2.12rc1,<2.22', # tensorflow transitive dep
646642
'absl-py>=0.12.0'
647643
],
648644
'transformers': [
@@ -659,10 +655,7 @@ def get_portability_package_data():
659655
],
660656
'redis': ['redis>=5.0.0,<6'],
661657
'tft': [
662-
'tensorflow_transform>=1.14.0,<1.15.0',
663-
# TFT->TFX-BSL require pandas 1.x, which is not compatible
664-
# with numpy 2.x
665-
'numpy<2',
658+
'tensorflow_transform>=1.21.0,<1.22.0',
666659
# tensorflow-transform requires dill, but doesn't set dill as a
667660
# hard requirement in setup.py.
668661
'dill'
@@ -672,7 +665,7 @@ def get_portability_package_data():
672665
'onnxruntime==1.13.1',
673666
'torch==1.13.1',
674667
'tensorflow==2.11.0',
675-
'tf2onnx==1.13.0',
668+
'tf2onnx==1.17.0',
676669
'skl2onnx==1.13',
677670
'transformers==4.25.1', # tensorflow transient dep
678671
'absl-py>=0.12.0'

sdks/python/tox.ini

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -335,23 +335,18 @@ extras = test
335335
commands =
336336
bash {toxinidir}/scripts/pytest_validates_runner.sh {envname} {toxinidir}/apache_beam/runners/portability/prism_runner_test.py {posargs}
337337

338-
[testenv:py{310,311}-pyarrow-{6,15,16,17,18,19,20,21,22,23}]
338+
[testenv:py{310,311}-pyarrow-{17,18,19,20,21,22,23,24,25}]
339339
deps =
340-
# As a courtesy to users, test against the oldest allowed version of Pyarrow.
341-
# We'd have to increase the pyarrow lower bound when Python 3.9 is deprecated.
342-
# Since Pandas 2 requires pyarrow>=7, downgrade pandas for this test.
343-
6: pyarrow>=6,<7
344-
6: pandas<2
345340
# Test against versions of pyarrow released in last ~2 years.
346-
15: pyarrow>=15,<16
347-
16: pyarrow>=16,<17
348341
17: pyarrow>=17,<18
349342
18: pyarrow>=18,<19
350343
19: pyarrow>=19,<20
351344
20: pyarrow>=20,<21
352345
21: pyarrow>=21,<22
353346
22: pyarrow>=22,<23
354347
23: pyarrow>=23,<24
348+
24: pyarrow>=24,<25
349+
25: pyarrow>=25,<26
355350
numpy==1.26.4
356351
commands =
357352
# Log pyarrow and numpy version for debugging

0 commit comments

Comments
 (0)