|
8 | 8 |
|
9 | 9 | from pandas._typing import DtypeObj |
10 | 10 |
|
11 | | -from tests import ( |
12 | | - check, |
13 | | - pytest_warns_bounded, |
14 | | -) |
| 11 | +from tests import check |
15 | 12 |
|
16 | 13 | nparr = np.array([1, 2, 3]) |
17 | 14 | arr = pd.Series([1, 2, 3]) |
@@ -55,20 +52,12 @@ def test_is_bool_dtype() -> None: |
55 | 52 |
|
56 | 53 |
|
57 | 54 | def test_is_categorical_dtype() -> None: |
58 | | - with pytest_warns_bounded( |
59 | | - FutureWarning, |
60 | | - match="is_categorical_dtype is deprecated and will be removed in a future version", |
61 | | - lower="2.0.99", |
62 | | - ): |
63 | | - check(assert_type(api.is_categorical_dtype(arr), bool), bool) |
64 | | - check(assert_type(api.is_categorical_dtype(nparr), bool), bool) |
65 | | - check(assert_type(api.is_categorical_dtype(dtylike), bool), bool) |
66 | | - check( |
67 | | - assert_type(api.is_categorical_dtype(dframe), bool), |
68 | | - bool, |
69 | | - ) |
70 | | - check(assert_type(api.is_categorical_dtype(ind), bool), bool) |
71 | | - check(assert_type(api.is_categorical_dtype(ExtensionDtype), bool), bool) |
| 55 | + check(assert_type(api.is_categorical_dtype(arr), bool), bool) |
| 56 | + check(assert_type(api.is_categorical_dtype(nparr), bool), bool) |
| 57 | + check(assert_type(api.is_categorical_dtype(dtylike), bool), bool) |
| 58 | + check(assert_type(api.is_categorical_dtype(dframe), bool), bool) |
| 59 | + check(assert_type(api.is_categorical_dtype(ind), bool), bool) |
| 60 | + check(assert_type(api.is_categorical_dtype(ExtensionDtype), bool), bool) |
72 | 61 |
|
73 | 62 |
|
74 | 63 | def test_is_complex() -> None: |
@@ -132,20 +121,12 @@ def test_is_datetime64_ns_dtype() -> None: |
132 | 121 |
|
133 | 122 |
|
134 | 123 | def test_is_datetime64tz_dtype() -> None: |
135 | | - with pytest_warns_bounded( |
136 | | - FutureWarning, |
137 | | - match="is_datetime64tz_dtype is deprecated and will be removed in a future version", |
138 | | - lower="2.0.99", |
139 | | - ): |
140 | | - check(assert_type(api.is_datetime64tz_dtype(arr), bool), bool) |
141 | | - check(assert_type(api.is_datetime64tz_dtype(nparr), bool), bool) |
142 | | - check(assert_type(api.is_datetime64tz_dtype(dtylike), bool), bool) |
143 | | - check( |
144 | | - assert_type(api.is_datetime64tz_dtype(dframe), bool), |
145 | | - bool, |
146 | | - ) |
147 | | - check(assert_type(api.is_datetime64tz_dtype(ind), bool), bool) |
148 | | - check(assert_type(api.is_datetime64tz_dtype(ExtensionDtype), bool), bool) |
| 124 | + check(assert_type(api.is_datetime64tz_dtype(arr), bool), bool) |
| 125 | + check(assert_type(api.is_datetime64tz_dtype(nparr), bool), bool) |
| 126 | + check(assert_type(api.is_datetime64tz_dtype(dtylike), bool), bool) |
| 127 | + check(assert_type(api.is_datetime64tz_dtype(dframe), bool), bool) |
| 128 | + check(assert_type(api.is_datetime64tz_dtype(ind), bool), bool) |
| 129 | + check(assert_type(api.is_datetime64tz_dtype(ExtensionDtype), bool), bool) |
149 | 130 |
|
150 | 131 |
|
151 | 132 | def test_is_dict_like() -> None: |
@@ -222,20 +203,12 @@ def test_is_hashable() -> None: |
222 | 203 |
|
223 | 204 |
|
224 | 205 | def test_is_int64_dtype() -> None: |
225 | | - with pytest_warns_bounded( |
226 | | - FutureWarning, |
227 | | - match="is_int64_dtype is deprecated and will be removed in a future version", |
228 | | - lower="2.0.99", |
229 | | - ): |
230 | | - check(assert_type(api.is_int64_dtype(arr), bool), bool) |
231 | | - check(assert_type(api.is_int64_dtype(nparr), bool), bool) |
232 | | - check(assert_type(api.is_int64_dtype(dtylike), bool), bool) |
233 | | - check( |
234 | | - assert_type(api.is_int64_dtype(dframe), bool), |
235 | | - bool, |
236 | | - ) |
237 | | - check(assert_type(api.is_int64_dtype(ind), bool), bool) |
238 | | - # check(assert_type(api.is_int64_dtype(ExtensionDtype), bool), bool) pandas GH 50923 |
| 206 | + check(assert_type(api.is_int64_dtype(arr), bool), bool) |
| 207 | + check(assert_type(api.is_int64_dtype(nparr), bool), bool) |
| 208 | + check(assert_type(api.is_int64_dtype(dtylike), bool), bool) |
| 209 | + check(assert_type(api.is_int64_dtype(dframe), bool), bool) |
| 210 | + check(assert_type(api.is_int64_dtype(ind), bool), bool) |
| 211 | + # check(assert_type(api.is_int64_dtype(ExtensionDtype), bool), bool) pandas GH 50923 |
239 | 212 |
|
240 | 213 |
|
241 | 214 | def test_is_integer() -> None: |
@@ -275,21 +248,13 @@ def test_is_interval() -> None: |
275 | 248 |
|
276 | 249 |
|
277 | 250 | def test_is_interval_dtype() -> None: |
278 | | - with pytest_warns_bounded( |
279 | | - FutureWarning, |
280 | | - match="is_interval_dtype is deprecated and will be removed in a future version", |
281 | | - lower="2.0.99", |
282 | | - ): |
283 | | - check(assert_type(api.is_interval_dtype(obj), bool), bool) |
284 | | - check(assert_type(api.is_interval_dtype(nparr), bool), bool) |
285 | | - check(assert_type(api.is_interval_dtype(dtylike), bool), bool) |
286 | | - check(assert_type(api.is_interval_dtype(arr), bool), bool) |
287 | | - check( |
288 | | - assert_type(api.is_interval_dtype(dframe), bool), |
289 | | - bool, |
290 | | - ) |
291 | | - check(assert_type(api.is_interval_dtype(ind), bool), bool) |
292 | | - check(assert_type(api.is_interval_dtype(ExtensionDtype), bool), bool) |
| 251 | + check(assert_type(api.is_interval_dtype(obj), bool), bool) |
| 252 | + check(assert_type(api.is_interval_dtype(nparr), bool), bool) |
| 253 | + check(assert_type(api.is_interval_dtype(dtylike), bool), bool) |
| 254 | + check(assert_type(api.is_interval_dtype(arr), bool), bool) |
| 255 | + check(assert_type(api.is_interval_dtype(dframe), bool), bool) |
| 256 | + check(assert_type(api.is_interval_dtype(ind), bool), bool) |
| 257 | + check(assert_type(api.is_interval_dtype(ExtensionDtype), bool), bool) |
293 | 258 |
|
294 | 259 |
|
295 | 260 | def test_is_iterator() -> None: |
@@ -362,20 +327,12 @@ def test_is_object_dtype() -> None: |
362 | 327 |
|
363 | 328 |
|
364 | 329 | def test_is_period_dtype() -> None: |
365 | | - with pytest_warns_bounded( |
366 | | - FutureWarning, |
367 | | - match="is_period_dtype is deprecated and will be removed in a future version", |
368 | | - lower="2.0.99", |
369 | | - ): |
370 | | - check(assert_type(api.is_period_dtype(arr), bool), bool) |
371 | | - check(assert_type(api.is_period_dtype(nparr), bool), bool) |
372 | | - check(assert_type(api.is_period_dtype(dtylike), bool), bool) |
373 | | - check( |
374 | | - assert_type(api.is_period_dtype(dframe), bool), |
375 | | - bool, |
376 | | - ) |
377 | | - check(assert_type(api.is_period_dtype(ind), bool), bool) |
378 | | - check(assert_type(api.is_period_dtype(ExtensionDtype), bool), bool) |
| 330 | + check(assert_type(api.is_period_dtype(arr), bool), bool) |
| 331 | + check(assert_type(api.is_period_dtype(nparr), bool), bool) |
| 332 | + check(assert_type(api.is_period_dtype(dtylike), bool), bool) |
| 333 | + check(assert_type(api.is_period_dtype(dframe), bool), bool) |
| 334 | + check(assert_type(api.is_period_dtype(ind), bool), bool) |
| 335 | + check(assert_type(api.is_period_dtype(ExtensionDtype), bool), bool) |
379 | 336 |
|
380 | 337 |
|
381 | 338 | def test_is_re() -> None: |
@@ -421,14 +378,9 @@ def test_is_signed_integer_dtype() -> None: |
421 | 378 |
|
422 | 379 |
|
423 | 380 | def test_is_sparse() -> None: |
424 | | - with pytest_warns_bounded( |
425 | | - FutureWarning, |
426 | | - match="is_sparse is deprecated and will be removed in a future version", |
427 | | - lower="2.0.99", |
428 | | - ): |
429 | | - check(assert_type(api.is_sparse(arr), bool), bool) |
430 | | - check(assert_type(api.is_sparse(nparr), bool), bool) |
431 | | - check(assert_type(api.is_sparse(dframe), bool), bool) |
| 381 | + check(assert_type(api.is_sparse(arr), bool), bool) |
| 382 | + check(assert_type(api.is_sparse(nparr), bool), bool) |
| 383 | + check(assert_type(api.is_sparse(dframe), bool), bool) |
432 | 384 |
|
433 | 385 |
|
434 | 386 | def test_is_string_dtype() -> None: |
|
0 commit comments