@@ -401,14 +401,19 @@ def _fill(
401
401
# the scalar is None when calling `is_valid`.
402
402
slr = cudf .Scalar (fill_value , dtype = self .dtype )
403
403
404
- if not inplace :
405
- return libcudf .filling .fill (self , begin , end , slr .device_value )
406
-
407
- if is_string_dtype (self .dtype ):
408
- return self ._mimic_inplace (
409
- libcudf .filling .fill (self , begin , end , slr .device_value ),
410
- inplace = True ,
411
- )
404
+ if not inplace or is_string_dtype (self .dtype ):
405
+ with acquire_spill_lock ():
406
+ result = type (self ).from_pylibcudf (
407
+ plc .filling .fill (
408
+ self .to_pylibcudf (mode = "read" ),
409
+ begin ,
410
+ end ,
411
+ slr .device_value .c_value ,
412
+ )
413
+ )
414
+ if is_string_dtype (self .dtype ):
415
+ return self ._mimic_inplace (result , inplace = True )
416
+ return result # type: ignore[return-value]
412
417
413
418
if not slr .is_valid () and not self .nullable :
414
419
mask = as_buffer (
@@ -418,8 +423,13 @@ def _fill(
418
423
)
419
424
self .set_base_mask (mask )
420
425
421
- libcudf .filling .fill_in_place (self , begin , end , slr .device_value )
422
-
426
+ with acquire_spill_lock ():
427
+ plc .filling .fill_in_place (
428
+ self .to_pylibcudf (mode = "write" ),
429
+ begin ,
430
+ end ,
431
+ slr .device_value .c_value ,
432
+ )
423
433
return self
424
434
425
435
def shift (self , offset : int , fill_value : ScalarLike ) -> ColumnBase :
@@ -1813,11 +1823,18 @@ def as_column(
1813
1823
* range objects
1814
1824
"""
1815
1825
if isinstance (arbitrary , (range , pd .RangeIndex , cudf .RangeIndex )):
1816
- column = libcudf .filling .sequence (
1817
- len (arbitrary ),
1818
- as_device_scalar (arbitrary .start , dtype = cudf .dtype ("int64" )),
1819
- as_device_scalar (arbitrary .step , dtype = cudf .dtype ("int64" )),
1820
- )
1826
+ with acquire_spill_lock ():
1827
+ column = Column .from_pylibcudf (
1828
+ plc .filling .sequence (
1829
+ len (arbitrary ),
1830
+ as_device_scalar (
1831
+ arbitrary .start , dtype = np .dtype (np .int64 )
1832
+ ).c_value ,
1833
+ as_device_scalar (
1834
+ arbitrary .step , dtype = np .dtype (np .int64 )
1835
+ ).c_value ,
1836
+ )
1837
+ )
1821
1838
if cudf .get_option ("default_integer_bitwidth" ) and dtype is None :
1822
1839
dtype = cudf .dtype (
1823
1840
f'i{ cudf .get_option ("default_integer_bitwidth" )// 8 } '
0 commit comments