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

Function test_diff

dask/dataframe/dask_expr/tests/test_collection.py:558–573  ·  view source on GitHub ↗
(pdf, df, axis, periods)

Source from the content-addressed store, hash-verified

556@pytest.mark.parametrize("axis", ("index", 0, "columns", 1, None))
557@pytest.mark.parametrize("periods", (1, 2, None))
558def test_diff(pdf, df, axis, periods):
559 kwargs = {k: v for k, v in (("periods", periods), ("axis", axis)) if v}
560
561 actual = df.diff(**kwargs)
562 expected = pdf.diff(**kwargs)
563 assert_eq(expected, actual)
564
565 # Check projections
566 expected = df[["x"]].diff(**kwargs)
567 actual = df.diff(**kwargs)[["x"]]
568
569 # no optimization on axis 1
570 if axis in ("columns", 1):
571 assert actual._name == actual.simplify()._name
572 else:
573 assert actual.simplify()._name == expected.simplify()._name
574
575
576@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
diffMethod · 0.80
simplifyMethod · 0.45

Tested by

no test coverage detected