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

Function test_diff

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

Source from the content-addressed store, hash-verified

532@pytest.mark.parametrize("axis", ("index", 0, "columns", 1, None))
533@pytest.mark.parametrize("periods", (1, 2, None))
534def test_diff(pdf, df, axis, periods):
535 kwargs = {k: v for k, v in (("periods", periods), ("axis", axis)) if v}
536
537 actual = df.diff(**kwargs)
538 expected = pdf.diff(**kwargs)
539 assert_eq(expected, actual)
540
541 # Check projections
542 expected = df[["x"]].diff(**kwargs)
543 actual = df.diff(**kwargs)[["x"]]
544
545 # no optimization on axis 1
546 if axis in ("columns", 1):
547 assert actual._name == actual.simplify()._name
548 else:
549 assert actual.simplify()._name == expected.simplify()._name
550
551
552@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