| 5063 | @pytest.mark.parametrize("orient", ["columns", "index"]) |
| 5064 | @pytest.mark.parametrize("npartitions", [2, 5]) |
| 5065 | def 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 | |
| 5079 | def test_from_dict_raises(): |