| 2714 | |
| 2715 | @pytest.mark.parametrize("columns", [["b"], []]) |
| 2716 | def test_drop_columns(columns): |
| 2717 | # Check both populated and empty list argument |
| 2718 | # https://github.com/dask/dask/issues/6870 |
| 2719 | |
| 2720 | df = pd.DataFrame( |
| 2721 | { |
| 2722 | "a": [2, 4, 6, 8], |
| 2723 | "b": ["1a", "2b", "3c", "4d"], |
| 2724 | } |
| 2725 | ) |
| 2726 | ddf = dd.from_pandas(df, npartitions=2) |
| 2727 | ddf2 = ddf.drop(columns=columns) |
| 2728 | ddf["new"] = ddf["a"] + 1 # Check that ddf2 is not modified |
| 2729 | |
| 2730 | assert_eq(df.drop(columns=columns), ddf2) |
| 2731 | |
| 2732 | |
| 2733 | def test_gh580(): |