()
| 92 | |
| 93 | |
| 94 | def test_index_map(): |
| 95 | df = pd.DataFrame({"x": [1, 2, 3, 4, 5]}) |
| 96 | ddf = dd.from_pandas(df, npartitions=2) |
| 97 | assert ddf.known_divisions is True |
| 98 | |
| 99 | with pytest.warns(UserWarning): |
| 100 | cleared = ddf.index.map(lambda x: x * 10) |
| 101 | assert cleared.known_divisions is False |
| 102 | |
| 103 | with pytest.warns(UserWarning): |
| 104 | applied = ddf.index.map(lambda x: x * 10, is_monotonic=True) |
| 105 | assert applied.known_divisions is True |
| 106 | assert applied.divisions == tuple(x * 10 for x in ddf.divisions) |
| 107 | |
| 108 | |
| 109 | @pytest.mark.skipif(not PANDAS_GE_210, reason="Not available before") |
nothing calls this directly
no test coverage detected
searching dependent graphs…