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:2805–2824  ·  view source on GitHub ↗
(as_frame)

Source from the content-addressed store, hash-verified

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