MCPcopy
hub / github.com/dask/dask / test_index_map

Function test_index_map

dask/dataframe/tests/test_map.py:94–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93
94def 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")

Callers

nothing calls this directly

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…