Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,11 @@ def data(self):
array([1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
0, 0, 4, 0, 0, 0, 0, 0, 0, 0], dtype=uint8)
"""
warnings.warn(
"Series.data is deprecated and will be removed in a future version. "
"Use Series.to_pylibcudf()[0].data() instead.",
FutureWarning,
)
return self._column.data

@_performance_tracking
Expand Down
6 changes: 6 additions & 0 deletions python/cudf/cudf/tests/series/test_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,9 @@ def test_series_values_property(data):
gds_vals = gds.values
assert isinstance(gds_vals, cp.ndarray)
np.testing.assert_array_equal(gds_vals.get(), pds.values)


def test_series_data_property_deprecated():
s = cudf.Series([1, 2, 3])
with pytest.warns(FutureWarning):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick

Suggested change
with pytest.warns(FutureWarning):
with pytest.warns(FutureWarning, match=...):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. I'll fold this into #20304

s.data
Loading