diff --git a/python/cudf/cudf/_lib/column.pyx b/python/cudf/cudf/_lib/column.pyx index 6b907163bdb..8066858f422 100644 --- a/python/cudf/cudf/_lib/column.pyx +++ b/python/cudf/cudf/_lib/column.pyx @@ -217,7 +217,7 @@ cdef class Column: # be expensive. hasattr(value, "__cuda_array_interface__") ): - if isinstance(value, Buffer): + if isinstance(value, RefCountableBuffer): value = SimpleNamespace( __cuda_array_interface__=value._cai, owner=value diff --git a/python/cudf/cudf/options.py b/python/cudf/cudf/options.py index 115128921c8..54fedb7b23e 100644 --- a/python/cudf/cudf/options.py +++ b/python/cudf/cudf/options.py @@ -166,6 +166,25 @@ def _validator(val): return _validator +def _make_spill_validator(valid_options): + def _validator(val): + try: + if get_option("copy_on_write") and val: + raise ValueError( + "Spilling is not supported when copy on write is enabled. " + "Please set `copy_on_write` to `False`" + ) + except KeyError: + pass + if val not in valid_options: + raise ValueError( + f"{val} is not a valid option. " + f"Must be one of {set(valid_options)}." + ) + + return _validator + + def _integer_validator(val): try: int(val) @@ -230,7 +249,7 @@ def _integer_and_none_validator(val): \tValid values are True or False. Default is False. """ ), - _make_contains_validator([False, True]), + _make_spill_validator([False, True]), )