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

Function test_len

dask/dataframe/dask_expr/tests/test_collection.py:1661–1671  ·  view source on GitHub ↗
(df, pdf)

Source from the content-addressed store, hash-verified

1659 reason="Very flaky https://github.com/dask/dask/issues/12275", strict=False
1660)
1661def test_len(df, pdf):
1662 df2 = df[["x"]] + 1
1663 assert len(df2) == len(pdf)
1664
1665 assert len(df[df.x > 5]) == len(pdf[pdf.x > 5])
1666
1667 first = df2.partitions[0].compute()
1668 assert len(df2.partitions[0]) == len(first)
1669
1670 assert isinstance(Len(df2.expr).optimize(), expr.Literal)
1671 assert isinstance(expr.Lengths(df2.expr).optimize(), expr.Literal)
1672
1673
1674def test_astype_simplify(df, pdf):

Callers

nothing calls this directly

Calls 3

LenClass · 0.90
computeMethod · 0.45
optimizeMethod · 0.45

Tested by

no test coverage detected