()
| 293 | |
| 294 | |
| 295 | def test_getitem_integer_slice(): |
| 296 | df = pd.DataFrame({"A": range(6)}) |
| 297 | ddf = dd.from_pandas(df, 2) |
| 298 | # integer slicing is iloc based |
| 299 | with pytest.raises(NotImplementedError): |
| 300 | ddf[1:3] |
| 301 | |
| 302 | df = pd.DataFrame({"A": range(6)}, index=[1.0, 2.0, 3.0, 5.0, 10.0, 11.0]) |
| 303 | ddf = dd.from_pandas(df, 2) |
| 304 | # except for float dtype indexes |
| 305 | ctx = contextlib.nullcontext() |
| 306 | if PANDAS_GE_210 and not PANDAS_GE_300: |
| 307 | ctx = pytest.warns(FutureWarning, match="float-dtype index") |
| 308 | elif PANDAS_GE_300: |
| 309 | ctx = pytest.raises(NotImplementedError) |
| 310 | with ctx: |
| 311 | assert_eq(ddf[2:8], df[2:8]) |
| 312 | with ctx: |
| 313 | assert_eq(ddf[2:], df[2:]) |
| 314 | with ctx: |
| 315 | assert_eq(ddf[:8], df[:8]) |
| 316 | |
| 317 | |
| 318 | def test_loc_on_numpy_datetimes(): |
nothing calls this directly
no test coverage detected