|
3 | 3 | import numpy as np |
4 | 4 | import pytest |
5 | 5 |
|
6 | | -from pandas.compat import np_version_under1p20 |
7 | | - |
8 | 6 | import pandas as pd |
9 | 7 | import pandas._testing as tm |
10 | | -from pandas.core import ops |
11 | 8 | from pandas.core.arrays.sparse import ( |
12 | 9 | SparseArray, |
13 | 10 | SparseDtype, |
@@ -121,19 +118,7 @@ def test_float_scalar( |
121 | 118 | self, kind, mix, all_arithmetic_functions, fill_value, scalar, request |
122 | 119 | ): |
123 | 120 | op = all_arithmetic_functions |
124 | | - |
125 | | - if np_version_under1p20: |
126 | | - if op in [operator.floordiv, ops.rfloordiv]: |
127 | | - if op is operator.floordiv and scalar != 0: |
128 | | - pass |
129 | | - elif op is ops.rfloordiv and scalar == 0: |
130 | | - pass |
131 | | - else: |
132 | | - mark = pytest.mark.xfail(raises=AssertionError, reason="GH#38172") |
133 | | - request.node.add_marker(mark) |
134 | | - |
135 | 121 | values = np.array([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan]) |
136 | | - |
137 | 122 | a = SparseArray(values, kind=kind, fill_value=fill_value) |
138 | 123 | self._check_numeric_ops(a, scalar, values, scalar, mix, op) |
139 | 124 |
|
@@ -171,14 +156,6 @@ def test_float_same_index_with_nans( |
171 | 156 | ): |
172 | 157 | # when sp_index are the same |
173 | 158 | op = all_arithmetic_functions |
174 | | - |
175 | | - if ( |
176 | | - np_version_under1p20 |
177 | | - and op is ops.rfloordiv |
178 | | - and not (mix and kind == "block") |
179 | | - ): |
180 | | - mark = pytest.mark.xfail(raises=AssertionError, reason="GH#38172") |
181 | | - request.node.add_marker(mark) |
182 | 159 | values = np.array([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan]) |
183 | 160 | rvalues = np.array([np.nan, 2, 3, 4, np.nan, 0, 1, 3, 2, np.nan]) |
184 | 161 |
|
@@ -353,13 +330,7 @@ def test_bool_array_logical(self, kind, fill_value): |
353 | 330 |
|
354 | 331 | def test_mixed_array_float_int(self, kind, mix, all_arithmetic_functions, request): |
355 | 332 | op = all_arithmetic_functions |
356 | | - |
357 | | - if np_version_under1p20 and op in [operator.floordiv, ops.rfloordiv] and mix: |
358 | | - mark = pytest.mark.xfail(raises=AssertionError, reason="GH#38172") |
359 | | - request.node.add_marker(mark) |
360 | | - |
361 | 333 | rdtype = "int64" |
362 | | - |
363 | 334 | values = np.array([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan]) |
364 | 335 | rvalues = np.array([2, 0, 2, 3, 0, 0, 1, 5, 2, 0], dtype=rdtype) |
365 | 336 |
|
|
0 commit comments