MCPcopy
hub / github.com/dask/dask / test_diff

Function test_diff

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

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…