Skip to content

Commit

Permalink
Add note about DeviceScalar immutability
Browse files Browse the repository at this point in the history
  • Loading branch information
shwina committed Mar 18, 2021
1 parent b5054f9 commit c464705
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/cudf/cudf/_lib/scalar.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cdef class DeviceScalar:

def __init__(self, value, dtype):
"""
cudf.Scalar: Type representing a scalar value on the device
Type representing an *immutable* scalar value on the device
Parameters
----------
Expand All @@ -63,6 +63,7 @@ cdef class DeviceScalar:
self._set_value(value, dtype)

def _set_value(self, value, dtype):
# IMPORTANT: this should only ever be called from __init__
valid = not _is_null_host_scalar(value)

if pd.api.types.is_string_dtype(dtype):
Expand Down

0 comments on commit c464705

Please sign in to comment.