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

Function test_from_dict

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

Source from the content-addressed store, hash-verified

5063@pytest.mark.parametrize("orient", ["columns", "index"])
5064@pytest.mark.parametrize("npartitions", [2, 5])
5065def test_from_dict(dtype, orient, npartitions):
5066 data = {"a": range(10), "b": range(10)}
5067 expected = pd.DataFrame.from_dict(data, dtype=dtype, orient=orient)
5068 result = dd.DataFrame.from_dict(
5069 data, npartitions=npartitions, dtype=dtype, orient=orient
5070 )
5071 if orient == "index":
5072 # DataFrame only has two rows with this orientation
5073 assert result.npartitions == min(npartitions, 2)
5074 else:
5075 assert result.npartitions == npartitions
5076 assert_eq(result, expected)
5077
5078
5079def 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