diff --git a/python/pyarrow/_compute.pyx b/python/pyarrow/_compute.pyx index 789e710875e..23fed2c823b 100644 --- a/python/pyarrow/_compute.pyx +++ b/python/pyarrow/_compute.pyx @@ -2895,8 +2895,9 @@ cdef class Expression(_Weakrefable): ---------- type : DataType, default None Type to cast array to. - safe : boolean, default True - Whether to check for conversion errors such as overflow. + safe : bool or None, default None + Check for conversion errors such as overflow. If ``options`` is + omitted, ``None`` uses a safe cast. options : CastOptions, default None Additional checks pass by CastOptions diff --git a/python/pyarrow/array.pxi b/python/pyarrow/array.pxi index c4862df5978..7755a4fe0d9 100644 --- a/python/pyarrow/array.pxi +++ b/python/pyarrow/array.pxi @@ -1184,8 +1184,9 @@ cdef class Array(_PandasConvertible): ---------- target_type : DataType, default None Type to cast array to. - safe : boolean, default True - Whether to check for conversion errors such as overflow. + safe : bool or None, default None + Check for conversion errors such as overflow. If ``options`` is + omitted, ``None`` uses a safe cast. options : CastOptions, default None Additional checks pass by CastOptions memory_pool : MemoryPool, optional diff --git a/python/pyarrow/compute.py b/python/pyarrow/compute.py index 09de66c901b..234ff3b6656 100644 --- a/python/pyarrow/compute.py +++ b/python/pyarrow/compute.py @@ -355,8 +355,9 @@ def cast(arr, target_type=None, safe=None, options=None, memory_pool=None): arr : Array-like target_type : DataType or str Type to cast to - safe : bool, default True - Check for overflows or other unsafe conversions + safe : bool or None, default None + Check for overflows or other unsafe conversions. If ``options`` is + omitted, ``None`` uses a safe cast. options : CastOptions, default None Additional checks pass by CastOptions memory_pool : MemoryPool, optional diff --git a/python/pyarrow/scalar.pxi b/python/pyarrow/scalar.pxi index b6d6a5a1eaa..65b548a30a4 100644 --- a/python/pyarrow/scalar.pxi +++ b/python/pyarrow/scalar.pxi @@ -107,8 +107,9 @@ cdef class Scalar(_Weakrefable): ---------- target_type : DataType, default None Type to cast scalar to. - safe : boolean, default True - Whether to check for conversion errors such as overflow. + safe : bool or None, default None + Check for conversion errors such as overflow. If ``options`` is + omitted, ``None`` uses a safe cast. options : CastOptions, default None Additional checks pass by CastOptions memory_pool : MemoryPool, optional diff --git a/python/pyarrow/table.pxi b/python/pyarrow/table.pxi index 30fff040fc3..65f97d04b2d 100644 --- a/python/pyarrow/table.pxi +++ b/python/pyarrow/table.pxi @@ -546,8 +546,9 @@ cdef class ChunkedArray(_PandasConvertible): ---------- target_type : DataType, None Type to cast array to. - safe : boolean, default True - Whether to check for conversion errors such as overflow. + safe : bool or None, default None + Check for conversion errors such as overflow. If ``options`` is + omitted, ``None`` uses a safe cast. options : CastOptions, default None Additional checks pass by CastOptions @@ -3277,8 +3278,9 @@ cdef class RecordBatch(_Tabular): ---------- target_schema : Schema Schema to cast to, the names and order of fields must match. - safe : bool, default True - Check for overflows or other unsafe conversions. + safe : bool or None, default None + Check for overflows or other unsafe conversions. If ``options`` is + omitted, ``None`` uses a safe cast. options : CastOptions, default None Additional checks pass by CastOptions @@ -4627,8 +4629,9 @@ cdef class Table(_Tabular): ---------- target_schema : Schema Schema to cast to, the names and order of fields must match. - safe : bool, default True - Check for overflows or other unsafe conversions. + safe : bool or None, default None + Check for overflows or other unsafe conversions. If ``options`` is + omitted, ``None`` uses a safe cast. options : CastOptions, default None Additional checks pass by CastOptions