diff --git a/python/cudf/cudf/core/series.py b/python/cudf/cudf/core/series.py index 2616d5cd7a6..0a32121febe 100644 --- a/python/cudf/cudf/core/series.py +++ b/python/cudf/cudf/core/series.py @@ -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 diff --git a/python/cudf/cudf/tests/series/test_attributes.py b/python/cudf/cudf/tests/series/test_attributes.py index 1d3fa4f81a5..3d464649a5b 100644 --- a/python/cudf/cudf/tests/series/test_attributes.py +++ b/python/cudf/cudf/tests/series/test_attributes.py @@ -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): + s.data