MCPcopy
hub / github.com/dask/dask / test_dataframe_map

Function test_dataframe_map

dask/dataframe/tests/test_map.py:111–119  ·  view source on GitHub ↗
(na_action)

Source from the content-addressed store, hash-verified

109@pytest.mark.skipif(not PANDAS_GE_210, reason="Not available before")
110@pytest.mark.parametrize("na_action", [None, "ignore"])
111def test_dataframe_map(na_action):
112 df = pd.DataFrame({"x": [1, 2, 3, np.nan], "y": [10, 20, 30, 40]})
113 ddf = dd.from_pandas(df, npartitions=2)
114 with pytest.warns(UserWarning, match="meta"):
115 assert_eq(
116 ddf.map(lambda x: x + 1, na_action=na_action),
117 df.map(lambda x: x + 1, na_action=na_action),
118 )
119 assert_eq(ddf.map(lambda x: (x, x)), df.map(lambda x: (x, x)))
120
121
122def test_series_meta_raises():

Callers

nothing calls this directly

Calls 3

mapMethod · 0.95
assert_eqFunction · 0.90
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…