MCPcopy Create free account
hub / github.com/dask/dask / test_map_index

Function test_map_index

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

Source from the content-addressed store, hash-verified

138
139
140def test_map_index():
141 df = pd.DataFrame({"x": [1, 2, 3, 4, 5]})
142 ddf = dd.from_pandas(df, npartitions=2)
143 assert ddf.known_divisions is True
144 with pytest.warns(UserWarning, match="meta"):
145 cleared = ddf.index.map(lambda x: x * 10)
146 assert cleared.known_divisions is False
147
148 with pytest.warns(UserWarning, match="meta"):
149 applied = ddf.index.map(lambda x: x * 10, is_monotonic=True)
150 assert applied.known_divisions is True
151 assert applied.divisions == tuple(x * 10 for x in ddf.divisions)
152
153
154@pytest.mark.xfail(

Callers

nothing calls this directly

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected