Skip to content

Commit

Permalink
Add comments to explain test validation (#10176)
Browse files Browse the repository at this point in the history
PR to address #10151 (review)

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #10176
  • Loading branch information
galipremsagar authored Jan 31, 2022
1 parent c25d35b commit c52f483
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 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)
assert df2.a.dtype == df.a.dtype
# 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 c52f483

Please sign in to comment.