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

Function test_to_dask_array_unknown

dask/dataframe/tests/test_dataframe.py:2803–2822  ·  view source on GitHub ↗
(as_frame)

Source from the content-addressed store, hash-verified

2801
2802@pytest.mark.parametrize("as_frame", [False, True])
2803def test_to_dask_array_unknown(as_frame):
2804 s = pd.Series([1, 2, 3, 4, 5], name="foo")
2805 a = dd.from_pandas(s, npartitions=2)
2806
2807 if as_frame:
2808 a = a.to_frame()
2809
2810 result = a.to_dask_array()
2811 assert isinstance(result, da.Array)
2812 result = result.chunks
2813
2814 if as_frame:
2815 assert len(result) == 2
2816 assert result[1] == (1,)
2817 else:
2818 assert len(result) == 1
2819
2820 result = result[0]
2821 assert len(result) == 2
2822 assert all(np.isnan(x) for x in result)
2823
2824
2825@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

allFunction · 0.85
to_dask_arrayMethod · 0.80
to_frameMethod · 0.45

Tested by

no test coverage detected