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

Function test_avoid_alignment

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

Source from the content-addressed store, hash-verified

2082
2083
2084def test_avoid_alignment():
2085 a = pd.DataFrame({"x": range(100)})
2086 da = from_pandas(a, npartitions=4)
2087
2088 b = pd.DataFrame({"y": range(100)})
2089 b["z"] = b.y * 2
2090 db = from_pandas(b, npartitions=3)
2091
2092 # Give correct results even when misaligned
2093 assert_eq(a.x + b.y, da.x + db.y)
2094
2095 assert not any(isinstance(ex, OpAlignPartitions) for ex in (db.y + db.z).walk())
2096 assert not any(
2097 isinstance(ex, OpAlignPartitions) for ex in (da.x + db.y.sum()).walk()
2098 )
2099
2100
2101def 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