Setting the index with some non-numeric null raises error
(null_value)
| 3560 | |
| 3561 | @pytest.mark.parametrize("null_value", [None, pd.NaT, pd.NA]) |
| 3562 | def test_index_nulls(null_value): |
| 3563 | "Setting the index with some non-numeric null raises error" |
| 3564 | df = pd.DataFrame( |
| 3565 | {"numeric": [1, 2, 3, 4], "non_numeric": ["foo", "bar", "foo", "bar"]} |
| 3566 | ) |
| 3567 | # an object column with only some nulls fails |
| 3568 | ddf = dd.from_pandas(df, npartitions=2) |
| 3569 | with pytest.raises(NotImplementedError, match="presence of nulls"): |
| 3570 | ddf.set_index( |
| 3571 | ddf["non_numeric"].map( |
| 3572 | {"foo": "foo", "bar": null_value}, meta=ddf["non_numeric"]._meta |
| 3573 | ) |
| 3574 | ).compute() |
| 3575 | |
| 3576 | |
| 3577 | def test_set_index_with_index(): |