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

Function test_mixed_dask_array_operations_errors

dask/dataframe/tests/test_dataframe.py:4573–4587  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4571
4572
4573def test_mixed_dask_array_operations_errors():
4574 df = pd.DataFrame({"x": [1, 2, 3, 4, 5]}, index=[4, 5, 6, 7, 8])
4575 ddf = dd.from_pandas(df, npartitions=2)
4576
4577 x = da.arange(5, chunks=((1, 4),))
4578 x._chunks = ((np.nan, np.nan),)
4579
4580 with pytest.raises(ValueError):
4581 (ddf.x + x).compute()
4582
4583 x = da.arange(5, chunks=((2, 2, 1),))
4584 with pytest.raises(ValueError) as info:
4585 ddf.x + x
4586
4587 assert "add" in str(info.value) or "different numbers" in str(info.value)
4588
4589
4590def test_mixed_dask_array_multi_dimensional():

Callers

nothing calls this directly

Calls 2

arangeMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected