Skip to content

Commit 0542886

Browse files
authored
[BEAM-12907] Run DataFrame API tests with multiple pandas versions (#15587)
* Run DataFrame API tests with multiple pandas versions * create tasks in a loop, make sure they're run in precommit * Don't define tasks in a loop
1 parent 8c3af01 commit 0542886

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

sdks/python/test-suites/tox/py38/build.gradle

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,43 @@ apply from: "../common.gradle"
3434
// TODO(BEAM-8954): Remove this once tox uses isolated builds.
3535
testPy38Cython.mustRunAfter testPython38, testPy38CloudCoverage
3636

37-
(0..5).each {version ->
38-
// Create a test task for each major version of pyarrow
39-
toxTask "testPy38pyarrow-$version", "py38-pyarrow-$version"
40-
test.dependsOn "testPy38pyarrow-$version"
41-
preCommitPy38.dependsOn "testPy38pyarrow-$version"
42-
}
37+
// Create a test task for each major version of pyarrow
38+
toxTask "testPy38pyarrow-0", "py38-pyarrow-0"
39+
test.dependsOn "testPy38pyarrow-0"
40+
preCommitPy38.dependsOn "testPy38pyarrow-0"
41+
42+
toxTask "testPy38pyarrow-1", "py38-pyarrow-1"
43+
test.dependsOn "testPy38pyarrow-1"
44+
preCommitPy38.dependsOn "testPy38pyarrow-1"
45+
46+
toxTask "testPy38pyarrow-2", "py38-pyarrow-2"
47+
test.dependsOn "testPy38pyarrow-2"
48+
preCommitPy38.dependsOn "testPy38pyarrow-2"
49+
50+
toxTask "testPy38pyarrow-3", "py38-pyarrow-3"
51+
test.dependsOn "testPy38pyarrow-3"
52+
preCommitPy38.dependsOn "testPy38pyarrow-3"
53+
54+
toxTask "testPy38pyarrow-4", "py38-pyarrow-4"
55+
test.dependsOn "testPy38pyarrow-4"
56+
preCommitPy38.dependsOn "testPy38pyarrow-4"
57+
58+
toxTask "testPy38pyarrow-5", "py38-pyarrow-5"
59+
test.dependsOn "testPy38pyarrow-5"
60+
preCommitPy38.dependsOn "testPy38pyarrow-5"
61+
62+
// Create a test task for each minor version of pandas
63+
toxTask "testPy38pandas-11", "py38-pandas-11"
64+
test.dependsOn "testPy38pandas-11"
65+
preCommitPy38.dependsOn "testPy38pandas-11"
66+
67+
toxTask "testPy38pandas-12", "py38-pandas-12"
68+
test.dependsOn "testPy38pandas-12"
69+
preCommitPy38.dependsOn "testPy38pandas-12"
70+
71+
toxTask "testPy38pandas-13", "py38-pandas-13"
72+
test.dependsOn "testPy38pandas-13"
73+
preCommitPy38.dependsOn "testPy38pandas-13"
4374

4475
toxTask "whitespacelint", "whitespacelint"
4576

sdks/python/tox.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,14 @@ commands =
250250
# Run pytest directly rather using run_pytest.sh. It doesn't handle
251251
# selecting tests with -m (BEAM-12985)
252252
pytest -o junit_suite_name={envname} --junitxml=pytest_{envname}.xml -n 6 -m uses_pyarrow {posargs}
253+
254+
[testenv:py{36,37,38}-pandas-{11,12,13}]
255+
deps =
256+
11: pandas>=1.1.0,<1.2.0
257+
12: pandas>=1.2.0,<1.3.0
258+
13: pandas>=1.3.0,<1.4.0
259+
commands =
260+
# Log pandas and numpy version for debugging
261+
/bin/sh -c "pip freeze | grep -E '(pandas|numpy)'"
262+
# Run all DataFrame API unit tests
263+
{toxinidir}/scripts/run_pytest.sh {envname} 'apache_beam/dataframe'

0 commit comments

Comments
 (0)