Skip to content

Commit

Permalink
add comment to Series.tolist method (#17350)
Browse files Browse the repository at this point in the history
closes #15767

This PR adds comment to `Series.tolist` method. It mentions that the method will raise a `TypeError` when it's called and suggest alternatives.

Authors:
  - https://github.com/tequilayu
  - Michael Wang (https://github.com/isVoid)
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)

URL: #17350
  • Loading branch information
tequilayu authored Dec 3, 2024
1 parent b67c0a9 commit 12c77f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,19 @@ def drop(
)

def tolist(self):
"""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 "
"via the `tolist()` method. Consider using "
Expand Down

0 comments on commit 12c77f3

Please sign in to comment.