From 85dfeb52e0dc5e04fa19609e2675fe0cb7b5d7ac Mon Sep 17 00:00:00 2001 From: tequilayu Date: Sun, 17 Nov 2024 11:58:36 +0800 Subject: [PATCH 1/2] add comment to Series.tolist method --- python/cudf/cudf/core/series.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/cudf/cudf/core/series.py b/python/cudf/cudf/core/series.py index 9b60424c924..6f1ef3b76e3 100644 --- a/python/cudf/cudf/core/series.py +++ b/python/cudf/cudf/core/series.py @@ -943,6 +943,11 @@ def drop( ) def tolist(self): # noqa: D102 + """ + cuDF does not support conversion to host memory + via the `tolist()` method. Consider using + `.to_arrow().to_pylist()` to construct a Python list. + """ raise TypeError( "cuDF does not support conversion to host memory " "via the `tolist()` method. Consider using " From f2ce73f3af037b0e889946a334baf3135e01e31a Mon Sep 17 00:00:00 2001 From: isVoid Date: Wed, 20 Nov 2024 22:34:25 -0800 Subject: [PATCH 2/2] Address review comments --- python/cudf/cudf/core/series.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/python/cudf/cudf/core/series.py b/python/cudf/cudf/core/series.py index 6f1ef3b76e3..d172d8c26e3 100644 --- a/python/cudf/cudf/core/series.py +++ b/python/cudf/cudf/core/series.py @@ -943,10 +943,18 @@ def drop( ) def tolist(self): # noqa: D102 - """ - cuDF does not support conversion to host memory - via the `tolist()` method. Consider using - `.to_arrow().to_pylist()` to construct a Python list. + """Conversion to host memory lists is currently unsupported + + Raises + ------ + TypeError + If this method is called + + Notes + ----- + cuDF currently does not support implicity conversion from GPU stored series to + host stored lists. A `TypeError` is raised when this method is called. + Consider calling `.to_arrow().to_pylist()` to construct a Python list. """ raise TypeError( "cuDF does not support conversion to host memory "