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

Function test_sequential_joins

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

Source from the content-addressed store, hash-verified

77
78
79def test_sequential_joins():
80 # Pandas version of multiple inner joins
81 df1 = pd.DataFrame(
82 {"key": list(range(6)), "A": ["A0", "A1", "A2", "A3", "A4", "A5"]}
83 )
84 df2 = pd.DataFrame({"key": list(range(4)), "B": ["B0", "B1", "B2", "B3"]})
85 df3 = pd.DataFrame({"key": list(range(1, 5)), "C": ["C0", "C1", "C2", "C3"]})
86
87 join_pd = _pandas_join(df1, df2, ("_l", "_r"), how="inner")
88 multi_join_pd = _pandas_join(join_pd, df3, ("_l", "_r"), how="inner")
89
90 # Dask version of multiple inner joins
91 ddf1 = dd.from_pandas(df1, npartitions=3)
92 ddf2 = dd.from_pandas(df2, npartitions=2)
93 ddf3 = dd.from_pandas(df3, npartitions=2)
94
95 join_dd = ddf1.join(ddf2, how="inner", lsuffix="_l", rsuffix="_r")
96 multi_join_dd = join_dd.join(ddf3, how="inner", lsuffix="_l", rsuffix="_r")
97 assert_eq(multi_join_pd, multi_join_dd)
98
99
100def test_merge_asof_indexed():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
_pandas_joinFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected