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

Function test_join_recursive

dask/dataframe/dask_expr/tests/test_merge.py:151–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149
150
151def test_join_recursive():
152 pdf = pd.DataFrame({"x": [1, 2, 3], "y": 1}, index=pd.Index([1, 2, 3], name="a"))
153 df = from_pandas(pdf, npartitions=2)
154
155 pdf2 = pd.DataFrame(
156 {"a": [1, 2, 3, 4, 5, 6], "b": 1}, index=pd.Index([1, 2, 3, 4, 5, 6], name="a")
157 )
158 df2 = from_pandas(pdf2, npartitions=2)
159
160 pdf3 = pd.DataFrame({"c": [1, 2, 3], "d": 1}, index=pd.Index([1, 2, 3], name="a"))
161 df3 = from_pandas(pdf3, npartitions=2)
162
163 result = df.join([df2, df3], how="outer")
164 assert_eq(result, pdf.join([pdf2, pdf3], how="outer"))
165
166 result = df.join([df2, df3], how="left")
167 # The nature of our join might cast ints to floats
168 assert_eq(result, pdf.join([pdf2, pdf3], how="left"), check_dtype=False)
169
170
171def test_join_recursive_raises():

Callers

nothing calls this directly

Calls 3

joinMethod · 0.95
from_pandasFunction · 0.90
assert_eqFunction · 0.90

Tested by

no test coverage detected