MCPcopy Index your code
hub / github.com/dask/dask / test_to_dask_array_unknown

Function test_to_dask_array_unknown

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

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…