Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Jan 31, 2022
1 parent d5b4bef commit 1c7ae25
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/cudf/cudf/tests/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1c7ae25

Please sign in to comment.