MCPcopy
hub / github.com/dask/dask / test_from_dict

Function test_from_dict

dask/dataframe/tests/test_dataframe.py:5047–5058  ·  view source on GitHub ↗
(dtype, orient, npartitions)

Source from the content-addressed store, hash-verified

5045@pytest.mark.parametrize("orient", ["columns", "index"])
5046@pytest.mark.parametrize("npartitions", [2, 5])
5047def test_from_dict(dtype, orient, npartitions):
5048 data = {"a": range(10), "b": range(10)}
5049 expected = pd.DataFrame.from_dict(data, dtype=dtype, orient=orient)
5050 result = dd.DataFrame.from_dict(
5051 data, npartitions=npartitions, dtype=dtype, orient=orient
5052 )
5053 if orient == "index":
5054 # DataFrame only has two rows with this orientation
5055 assert result.npartitions == min(npartitions, 2)
5056 else:
5057 assert result.npartitions == npartitions
5058 assert_eq(result, expected)
5059
5060
5061def test_from_dict_raises():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
minFunction · 0.85
from_dictMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…