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

Function test_nunique_approx

dask/dataframe/dask_expr/tests/test_reductions.py:211–214  ·  view source on GitHub ↗
(split_every, pdf, df)

Source from the content-addressed store, hash-verified

209
210@pytest.mark.parametrize("split_every", [None, False, 2, 10])
211def test_nunique_approx(split_every, pdf, df):
212 approx = df.nunique_approx(split_every=split_every).compute()
213 exact = len(df.drop_duplicates())
214 assert abs(approx - exact) <= 2 or abs(approx - exact) / exact < 0.05
215
216
217def test_unique_base(df, pdf):

Callers

nothing calls this directly

Calls 3

computeMethod · 0.45
nunique_approxMethod · 0.45
drop_duplicatesMethod · 0.45

Tested by

no test coverage detected