Commit 71cfba0
committed
[SPARK-23319][TESTS] Explicitly specify Pandas and PyArrow versions in PySpark tests (to skip or test)
## What changes were proposed in this pull request?
This PR proposes to explicitly specify Pandas and PyArrow versions in PySpark tests to skip or test.
We declared the extra dependencies:
https://github.com/apache/spark/blob/b8bfce51abf28c66ba1fc67b0f25fe1617c81025/python/setup.py#L204
In case of PyArrow:
Currently we only check if pyarrow is installed or not without checking the version. It already fails to run tests. For example, if PyArrow 0.7.0 is installed:
```
======================================================================
ERROR: test_vectorized_udf_wrong_return_type (pyspark.sql.tests.ScalarPandasUDF)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/.../spark/python/pyspark/sql/tests.py", line 4019, in test_vectorized_udf_wrong_return_type
f = pandas_udf(lambda x: x * 1.0, MapType(LongType(), LongType()))
File "/.../spark/python/pyspark/sql/functions.py", line 2309, in pandas_udf
return _create_udf(f=f, returnType=return_type, evalType=eval_type)
File "/.../spark/python/pyspark/sql/udf.py", line 47, in _create_udf
require_minimum_pyarrow_version()
File "/.../spark/python/pyspark/sql/utils.py", line 132, in require_minimum_pyarrow_version
"however, your version was %s." % pyarrow.__version__)
ImportError: pyarrow >= 0.8.0 must be installed on calling Python process; however, your version was 0.7.0.
----------------------------------------------------------------------
Ran 33 tests in 8.098s
FAILED (errors=33)
```
In case of Pandas:
There are few tests for old Pandas which were tested only when Pandas version was lower, and I rewrote them to be tested when both Pandas version is lower and missing.
## How was this patch tested?
Manually tested by modifying the condition:
```
test_createDataFrame_column_name_encoding (pyspark.sql.tests.ArrowTests) ... skipped 'Pandas >= 1.19.2 must be installed; however, your version was 0.19.2.'
test_createDataFrame_does_not_modify_input (pyspark.sql.tests.ArrowTests) ... skipped 'Pandas >= 1.19.2 must be installed; however, your version was 0.19.2.'
test_createDataFrame_respect_session_timezone (pyspark.sql.tests.ArrowTests) ... skipped 'Pandas >= 1.19.2 must be installed; however, your version was 0.19.2.'
```
```
test_createDataFrame_column_name_encoding (pyspark.sql.tests.ArrowTests) ... skipped 'Pandas >= 0.19.2 must be installed; however, it was not found.'
test_createDataFrame_does_not_modify_input (pyspark.sql.tests.ArrowTests) ... skipped 'Pandas >= 0.19.2 must be installed; however, it was not found.'
test_createDataFrame_respect_session_timezone (pyspark.sql.tests.ArrowTests) ... skipped 'Pandas >= 0.19.2 must be installed; however, it was not found.'
```
```
test_createDataFrame_column_name_encoding (pyspark.sql.tests.ArrowTests) ... skipped 'PyArrow >= 1.8.0 must be installed; however, your version was 0.8.0.'
test_createDataFrame_does_not_modify_input (pyspark.sql.tests.ArrowTests) ... skipped 'PyArrow >= 1.8.0 must be installed; however, your version was 0.8.0.'
test_createDataFrame_respect_session_timezone (pyspark.sql.tests.ArrowTests) ... skipped 'PyArrow >= 1.8.0 must be installed; however, your version was 0.8.0.'
```
```
test_createDataFrame_column_name_encoding (pyspark.sql.tests.ArrowTests) ... skipped 'PyArrow >= 0.8.0 must be installed; however, it was not found.'
test_createDataFrame_does_not_modify_input (pyspark.sql.tests.ArrowTests) ... skipped 'PyArrow >= 0.8.0 must be installed; however, it was not found.'
test_createDataFrame_respect_session_timezone (pyspark.sql.tests.ArrowTests) ... skipped 'PyArrow >= 0.8.0 must be installed; however, it was not found.'
```
Author: hyukjinkwon <[email protected]>
Closes #20487 from HyukjinKwon/pyarrow-pandas-skip.1 parent 9775df6 commit 71cfba0
File tree
6 files changed
+89
-48
lines changed- python
- pyspark/sql
6 files changed
+89
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1913 | 1913 | | |
1914 | 1914 | | |
1915 | 1915 | | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
1916 | 1919 | | |
1917 | 1920 | | |
1918 | 1921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
649 | 652 | | |
650 | 653 | | |
651 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
53 | 52 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
| |||
2794 | 2792 | | |
2795 | 2793 | | |
2796 | 2794 | | |
2797 | | - | |
2798 | 2795 | | |
2799 | 2796 | | |
2800 | 2797 | | |
| |||
2807 | 2804 | | |
2808 | 2805 | | |
2809 | 2806 | | |
2810 | | - | |
| 2807 | + | |
2811 | 2808 | | |
2812 | 2809 | | |
2813 | 2810 | | |
| |||
2819 | 2816 | | |
2820 | 2817 | | |
2821 | 2818 | | |
2822 | | - | |
2823 | | - | |
| 2819 | + | |
| 2820 | + | |
2824 | 2821 | | |
2825 | 2822 | | |
2826 | 2823 | | |
2827 | 2824 | | |
2828 | | - | |
| 2825 | + | |
2829 | 2826 | | |
2830 | 2827 | | |
2831 | 2828 | | |
| |||
2843 | 2840 | | |
2844 | 2841 | | |
2845 | 2842 | | |
2846 | | - | |
| 2843 | + | |
2847 | 2844 | | |
2848 | 2845 | | |
2849 | 2846 | | |
| |||
2858 | 2855 | | |
2859 | 2856 | | |
2860 | 2857 | | |
2861 | | - | |
2862 | | - | |
2863 | | - | |
2864 | | - | |
2865 | | - | |
2866 | | - | |
| 2858 | + | |
| 2859 | + | |
2867 | 2860 | | |
2868 | | - | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
2869 | 2868 | | |
2870 | 2869 | | |
2871 | 2870 | | |
| |||
3383 | 3382 | | |
3384 | 3383 | | |
3385 | 3384 | | |
3386 | | - | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
3387 | 3388 | | |
3388 | 3389 | | |
3389 | 3390 | | |
| |||
3641 | 3642 | | |
3642 | 3643 | | |
3643 | 3644 | | |
3644 | | - | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
3645 | 3648 | | |
3646 | 3649 | | |
3647 | 3650 | | |
| |||
3765 | 3768 | | |
3766 | 3769 | | |
3767 | 3770 | | |
3768 | | - | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
3769 | 3774 | | |
3770 | 3775 | | |
3771 | 3776 | | |
| |||
4278 | 4283 | | |
4279 | 4284 | | |
4280 | 4285 | | |
4281 | | - | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
4282 | 4289 | | |
4283 | 4290 | | |
4284 | 4291 | | |
| |||
4447 | 4454 | | |
4448 | 4455 | | |
4449 | 4456 | | |
4450 | | - | |
| 4457 | + | |
| 4458 | + | |
| 4459 | + | |
4451 | 4460 | | |
4452 | 4461 | | |
4453 | 4462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
118 | 121 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
123 | 130 | | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
127 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
128 | 138 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| |||
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
204 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
205 | 213 | | |
206 | 214 | | |
207 | 215 | | |
| |||
0 commit comments