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

Function test_multi_duplicate_divisions

dask/dataframe/tests/test_multi.py:2080–2095  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2078
2079
2080def test_multi_duplicate_divisions():
2081 df1 = pd.DataFrame({"x": [0, 0, 0, 0]})
2082 df2 = pd.DataFrame({"x": [0]})
2083
2084 ddf1 = dd.from_pandas(df1, npartitions=2).set_index("x")
2085 ddf2 = dd.from_pandas(df2, npartitions=1).set_index("x")
2086 assert ddf1.npartitions <= 2
2087 assert len(ddf1) == len(df1)
2088
2089 r1 = ddf1.merge(ddf2, how="left", left_index=True, right_index=True)
2090
2091 sf1 = df1.set_index("x")
2092 sf2 = df2.set_index("x")
2093 r2 = sf1.merge(sf2, how="left", left_index=True, right_index=True)
2094
2095 assert_eq(r1, r2)
2096
2097
2098def test_merge_outer_empty():

Callers

nothing calls this directly

Calls 3

set_indexMethod · 0.95
assert_eqFunction · 0.90
mergeMethod · 0.45

Tested by

no test coverage detected