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

Function test_avoid_alignment

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

Source from the content-addressed store, hash-verified

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