Skip to content

Commit

Permalink
Test slice indexing of an empty struct column with nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed May 9, 2023
1 parent 421ac67 commit 34d6b07
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion python/cudf/cudf/tests/test_struct.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2022, NVIDIA CORPORATION.
# Copyright (c) 2020-2023, NVIDIA CORPORATION.

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -392,3 +392,24 @@ def test_struct_with_null_memory_usage():

s[2:4] = None
assert s.memory_usage() == 272


@pytest.mark.parametrize(
"zlice",
[
pytest.param(
slice(0, 3),
marks=pytest.mark.xfail(
reason="https://github.com/rapidsai/cudf/issues/13305"
),
),
slice(1, 4),
],
)
def test_struct_empty_children_nulls_slice(zlice):
values = [None, {}, {}, None]

s = cudf.Series([None, {}, {}, None])
actual = s.iloc[zlice]
expect = cudf.Series(values[zlice], index=range(len(values))[zlice])
assert_eq(actual, expect)

0 comments on commit 34d6b07

Please sign in to comment.