From 1c7ae2578f7615882fa00668bb0b4096962a5b06 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Mon, 31 Jan 2022 11:36:48 -0800 Subject: [PATCH] add comments --- python/cudf/cudf/tests/test_list.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/cudf/cudf/tests/test_list.py b/python/cudf/cudf/tests/test_list.py index 3ef579574c6..ef61492b447 100644 --- a/python/cudf/cudf/tests/test_list.py +++ b/python/cudf/cudf/tests/test_list.py @@ -593,7 +593,12 @@ def test_listcol_setitem_retain_dtype(): df = cudf.DataFrame( {"a": cudf.Series([["a", "b"], []]), "b": [1, 2], "c": [123, 321]} ) - df1 = df[df.b.isna()] + df1 = df.head(0) + # Performing a setitem on `b` triggers a `column.column_empty_like` call + # which tries to create an empty ListColumn. df1["b"] = df1["c"] - df2 = df1.drop(["c"], axis=1) + # Performing a copy to trigger a copy dtype which is obtained by accessing + # `ListColumn.children` that would have been corrupted in previous call + # prior to this fix: https://github.com/rapidsai/cudf/pull/10151/ + df2 = df1.copy() assert df2.a.dtype == df.a.dtype