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

Function test_join

dask/dataframe/dask_expr/tests/test_merge.py:131–148  ·  view source on GitHub ↗
(how, shuffle_method)

Source from the content-addressed store, hash-verified

129@pytest.mark.parametrize("how", ["left", "right", "inner", "outer"])
130@pytest.mark.parametrize("shuffle_method", ["tasks", "disk"])
131def test_join(how, shuffle_method):
132 # Make simple left & right dfs
133 pdf1 = pd.DataFrame({"x": range(20), "y": range(20)})
134 df1 = from_pandas(pdf1, 4)
135 pdf2 = pd.DataFrame({"z": range(10)}, index=pd.Index(range(10), name="a"))
136 df2 = from_pandas(pdf2, 2)
137
138 # Partition-wise merge with map_partitions
139 df3 = df1.join(df2, on="x", how=how, shuffle_method=shuffle_method)
140
141 # Check result with/without fusion
142 expect = pdf1.join(pdf2, on="x", how=how)
143 assert_eq(df3.compute(), expect, check_index=False)
144 assert_eq(df3.optimize(), expect, check_index=False)
145
146 df3 = df1.join(df2.z, on="x", how=how, shuffle_method=shuffle_method)
147 assert_eq(df3, expect, check_index=False)
148 assert_eq(df3.optimize(), expect, check_index=False)
149
150
151def test_join_recursive():

Callers

nothing calls this directly

Calls 5

joinMethod · 0.95
from_pandasFunction · 0.90
assert_eqFunction · 0.90
computeMethod · 0.45
optimizeMethod · 0.45

Tested by

no test coverage detected