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

Function test_avoid_alignment

dask/dataframe/dask_expr/tests/test_collection.py:2122–2136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2120
2121
2122def test_avoid_alignment():
2123 a = pd.DataFrame({"x": range(100)})
2124 da = from_pandas(a, npartitions=4)
2125
2126 b = pd.DataFrame({"y": range(100)})
2127 b["z"] = b.y * 2
2128 db = from_pandas(b, npartitions=3)
2129
2130 # Give correct results even when misaligned
2131 assert_eq(a.x + b.y, da.x + db.y)
2132
2133 assert not any(isinstance(ex, OpAlignPartitions) for ex in (db.y + db.z).walk())
2134 assert not any(
2135 isinstance(ex, OpAlignPartitions) for ex in (da.x + db.y.sum()).walk()
2136 )
2137
2138
2139def test_mixed_array_op(df, pdf):

Callers

nothing calls this directly

Calls 5

from_pandasFunction · 0.90
assert_eqFunction · 0.90
anyFunction · 0.85
walkMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected